niceguy971
asked on
C# - the method to get a number of open Sql connections
What would be the best way to create a method which returns the number of open Sql connections? Let say I'm debugging my code (or even at some points in the code) - i would like to check at some point and make sure that all connections where closed.
SqlConnection connection = new SqlConnection( connectionString)
Thanks
SqlConnection connection = new SqlConnection( connectionString)
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Really intresting!! But using the 'using' keyword requires no need to verify this extra work. That is the best practice. No connection or memory leak will happen. We have used in our real project and found good improvement in performance as well.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
ASKER
Thanks