Link to home
Start Free TrialLog in
Avatar of ennixo
ennixoFlag for France

asked on

Closing a connection which is in Session state and the connection is still open in Enterprise Manager

Hi, i've got a web application which creates and open a connection in the page load and then stores it in the session state.

the problem is that when i want to close the connection :
SqlConnection mySqlConnection = (SqlConnection) Session["mySqlConnection"];
mySqlConnection.Close();
mySqlConnection.Dispose();
Session["mySqlConnection"] = null;

it is still visible and open in Enterprise Manager

the real problem is that when there are a lot of activity on this application, all the connections stay opened and so the pool becomes full and noone can connect =/

what's the problem ?

ASKER CERTIFIED SOLUTION
Avatar of Fred Goodwin
Fred Goodwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ennixo

ASKER

i agree and i'll change this, do you think the fact to store it in the Session state can make it "unclosable" ?
Avatar of ennixo

ASKER

i changed it, now i don't see the connections in Enterprise Manager since it is closed just after executing commands.

thank you =)
no problem.  Im glad that I could help.