I have a question about ADO.Net's way of handling connections. My server app uses ADO.Net to connect to SQL Server to server clients' calls. Some times I get error message that says that I may run out of connections in the pool and I should consider exband the size of the connection pool (not the exact words). I am a little confused by this error because, to my knowlege, the connection pooling is by defualt set to a certain size. If all the connections in the pool are taken and when a new connection is requested, ADO will automaticly increase the pool size, isn't it? If so, why do I get the error message? If not, what should I do to avoid this kind of error?
Thanks a million.
Are you closing/disposing you database connection when they are not needed anymore ?
Take a look at this for more details
No. The connection pool size (for your connection) is set by the connection string. The default size is 100 which is rougly 4 times the size you need.
Yes, you need to ensure that you're closing your connections. Make sure that you have exception handlers that close the connection if there is an issue.
See my article on www.betav.com on managing the connection pool.