During an ASP.NET page load I’m opening and closing multiple System.Data.SqlClient.SqlConnections inside multiple controls contained in the page. I thought it would be a good idea instead to create a ‘pool’ of connections and when opening a connection check to see if the connection string matches that of an open connection in the pool, and return that connection. I was expecting to see a difference in the page load times, but I haven’t seen any change. I know that with PHP if you attempt to open a new connection with a connection string that has already been used in that page request it won’t attempt to open a new connection and will return the existing open connection instead. Is this true with .NET?
During an ASP.NET page load I’m opening and closing multiple System.Data.SqlClient.SqlConnections inside multiple controls
Share
Connection pooling is an essential feature of ADO.NET.
Read this MSDN article or some of the other resources available on the net, like this blog post