Connection pooling
How can connection pooling be enabled?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Jan 18, 2012, 2:57 AM EST
Data Source=..;User Id=..;Password=..;Polling=true;MinPool Size=10;MaxPoll Size=100;
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 18, 2012, 5:26 PM EST
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.
Mukesh KumarRank #615 · 3.9K reputationPosted Jan 18, 2012, 6:11 PM EST
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>