To take advantage of connection pooling, you must be careful to do two things in your ASP.NET pages. First, you must be careful to use the same exact connection string whenever you open a database connection. Only those connections opened with the same connection string can be placed in the same connection pool.
Realize that even very small differences in the connection string can thwart connection pooling. Connections are pooled only when they are opened with connection strings that exactly match character by character. For this reason, it is wise to create your connection string in one place and use the same connection string within all your ASP.NET pages. For example, you can place your connection string in the web.config file and retrieve it from this file whenever you need to open a connection. Another option is to place the connection string in Application state within the Global.asax file.
When using SQL connection pooling, you can place additional options in a connection string to modify how connection pooling works. For example, you can specify the minimum and maximum size of the connection pool or even completely disable connection pooling.
Here's a list of the connection pooling options that you can add to the SQL Server connection string:
Connection Lifetime— Destroys a connection after a certain number of seconds. The default value is 0, which indicates that connections should never be destroyed.
Connection Reset— Indicates whether connections should be reset when they are returned to the pool. The default value is true.
Enlist— Indicates whether a connection should be automatically enlisted in the current transaction context. The default value is true.
Max Pool Size— The maximum number of connections allowed in a single connection pool. The default value is 100.
Min Pool Size— The minimum number of connections allowed in a single connection pool. The default value is 0.
Pooling— Determines whether connection pooling is enabled or disabled. The default value is true.