Skip navigation links

MySQL Forums :: Connector/NET and C#, Mono, .Net :: Error: Too many connections


Advanced Search

Re: Error: Too many connections
Posted by: rene98c ()
Date: February 23, 2005 03:22AM

Hi
I once had this kind of a problem.
Webserver ASP.net and mysql, and one webform page.
And always connections were filled, till the maximum came.
I did'nt get the answer why.
But as soon as I migrated code to windows forms, everythink was ok.
This is some sort of a webserver's behaviour,I had to restart the server computer
to reset the alive connections that were not in use any more.Yes there was a way of
killing these alive useless connections,but this was not the answer.

I'm quite sure there is answer for that :).
I Think this was How I wrote the code(C# and ByteFX<-- now its .Net provider):

MySqlConnection conn = new MySqlConnection(connectionString);
MySqlCommand cmd = new MySqlCommand(commandString,conn);
MySqlDataReader dr = cmd.ExecuteDataReader();
conn.Open();

while(dr.Read())
{
....do this and this
}

dr.Close();
conn.Close();

Even the connection is closed, and also browser is closed, theres connection in mysql server variable.

Options: ReplyQuote


Subject Written By Posted
Error: Too many connections Valere Palhories 02/21/2005 07:20AM
Re: Error: Too many connections rene98c 02/23/2005 03:22AM
Re: Error: Too many connections Nagasri 11/29/2005 12:37AM
Re: Error: Too many connections chaitu 12/19/2005 06:25AM


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.