Connection pooling
How can connection pooling be enabled?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mukesh KumarPosted Jan 18, 2012, 11:11 PM
string sqlConnectString = "Data Source=localhost;Integrated security=SSPI;Initial Catalog=AdventureWorks;";
SqlConnection connection = new SqlConnection();
// Set the connection string with pooling option
connection.ConnectionString = sqlConnectString + "Connection Timeout=30;Connection Lifetime=0;Min Pool Size=0;Max Pool Size=100;Pooling=true;";
A Connection String in the Web.Config file with connection pooling option:
<connectionStrings>
<clear />
<add name="sqlConnectionString" connectionString="Data Source=mySQLServer;Initial Catalog=myDatabase;Integrated Security=True;Connection Timeout=15;Connection Lifetime=0;Min Pool Size=0;Max Pool Size=100;Pooling=true;" />
connectionStrings>
Jignesh TrivediPosted Jan 18, 2012, 10:26 PM
In connection string, you must enable pooling and assign maximum pooling size.
please refer.
http://www.codeproject.com/KB/dotnet/ADONET_ConnectionPooling.aspx
http://msdn.microsoft.com/en-us/library/8xx3tyca%28v=vs.71%29.aspx
hope this help.
Krishna GaradPosted Jan 18, 2012, 7:57 AM
Data Source=..;User Id=..;Password=..;Polling=true;MinPool Size=10;MaxPoll Size=100;