DataAdapter won't disconnect?
Posted by: Bryan Luisana
Date: February 02, 2005 08:15AM

Hello,

Is anyone else having an issue when using the a datadapter.

Even doing something as simple as this creates a conneciton that sleeps after I am done with it. This means that everytime a new user connects to my webpage a new conneciton is made untill mysql max connections is reached.

MySqlConnection connection = new MySqlConnection(constr);

MySqlCommand myCommand = new MySqlCommand(sqlCommand);
myCommand.CommandType = CommandType.Text;

myCommand.Connection=connection;
MySqlDataAdapter dataAdapter = new MySqlDataAdapter(myCommand);
DataTable myDataTable = new DataTable();

try
{
connection.Open();
dataAdapter.Fill(myDataTable);
connection.Close();
dataAdapter.Dispose();
}

Neither the close nor the dispose method make the connection to the database close?

HELP!!

Options: ReplyQuote


Subject
Written By
Posted
DataAdapter won't disconnect?
February 02, 2005 08:15AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.