D
davidw
I have code like this
try{
sqlConn = new SqlConnection(gDSN);
sqlConn.Open();
.....
....
catch(Exception e) {
ShowError("...", e);
}
finally {
if(sqlConn!=null)
{
sqlConn.Close();
sqlConn.Dispose();
}
}
But it seems the connection can not be released, and it accumulates to 100
and then no more connection unless I restart the project. Any idea?
try{
sqlConn = new SqlConnection(gDSN);
sqlConn.Open();
.....
....
catch(Exception e) {
ShowError("...", e);
}
finally {
if(sqlConn!=null)
{
sqlConn.Close();
sqlConn.Dispose();
}
}
But it seems the connection can not be released, and it accumulates to 100
and then no more connection unless I restart the project. Any idea?