5
Reply

Related Ado.net For MySql

kedar pawgi

kedar pawgi

Oct 5 2017 5:22 AM
144
Hi i have just shifted from ADODB to Ado.net for MySql. I am new to this system.
After going thru the forums i have defined the connection, adapter, reader , command. 
 
I defined in all this in a class, i am calling that class in every form so that i dont have to created the same for every form. I have written things like following
  1. public MySqlConnection conn;  
  2. public MySqlCommand cmd;  
  3. public MySqlDataReader dr;  
  4. public MySqlDataAdapter da;
  5.        
the DB is conneced through DSN. Here everything is working fine. But while working i got error message like
 
"There is already an open DataReader associated with this Command which must be closed"
 
So i searched on forum, but i being new to this things , i request you to please kindly suggest how i can close connect, open connected and how i should declear variables in a class. 
 
 I will be very thankful for this in advance. i am developing a customized software , so asap help is very much appriciated.
 
Thank you

Answers (5)