Thursday 14 July 2016

What will happen when you do not dispose or close SqlConnection object in c#?



If you do not close or dispose SqlConnection object then below possibilities may happen

1.)   If you open the connection and do not close, it will decrease connection pool  size and after some connection pool size cross the limits. 
2.)   You may get error like
"Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached."

No comments:

Post a Comment

Note: only a member of this blog may post a comment.