Connection Pooling

Opening a connection to the database is an expensive operation in the form of both time and memory. If you had to open and close a connection to the database each time it was required by your application, the performance of your application would deteriorate, particularly if there are many concurrent users.

Luckily, both the OLE DB and managed SQL providers in ADO.NET automatically provide connection pooling. Connection pooling creates persistent connections to the database that can be shared, as needed. If a connection attempt is made and all connections are currently in use, another connection is added to the pool.

A separate ...

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.