Friday, March 23, 2012

How to Enable Connection Pooling

How can you enable connection pooling from an application server that
connects to a SQL server on a different server?try this:
conn = new SqlConnection();
try
{
conn.ConnectionString = "integrated
security=SSPI;SERVER=YOUR_SERVER;DATABAS
E=YOUR_DB_NAME;Min Pool Size=5;Max
Pool Size=60;Connect Timeout=10;"; // Notice Connection Timeout set to
only 10 seconds!
conn.Open();
}
catch(Exception ex)
{
label1.text = ex.Message
}

No comments:

Post a Comment