connections using this database: 105

  • Thread starter Thread starter Guoqi Zheng
  • Start date Start date
G

Guoqi Zheng

It is a little strange but I got 105 connections on the database of my new
application.

It sounds that each time, one user login, the connections always remains
there for forever. I am always use microsoft application block for data
access.

Any idea where should I look for the problem???

--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com
 
Are you explicitly closing and disposing your connections? Like this...
cmd.Connection.Close();
cmd.Connection.Dispose();
cmd.Dispose();


-GH
 
Are you explicitly closing and disposing your connections? Like this...
cmd.Connection.Close();
cmd.Connection.Dispose();
cmd.Dispose();

Do you need to dispose in .net? My understanding was that 'dispose' was now
one of the automatic garbage collection things that .net can take care of
for you.

-Darrel
 
Yes, it's very important to call Dispose on many of the disposable
objects, like connections. Dispose frees the connection back into the
connection pool.
 
It isn't necessary to call Dispose() if you call Close() on the Connection.
Likewise, it isn't necessary to call Close() if you call Dispose().

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
What methods are you using to access your database?
If you're using ExecuteScalar, you ought to be ok, but if you're using
ExecuteReader you'll need to dispose your DataReader.
 
Back
Top