Click here to Skip to main content
15,886,056 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How To remove the timeout expired and connection pooling problem
Posted
Comments
William Winner 30-Jul-10 13:42pm    
Reason for my vote of 1
um...you need to provide a bit more information than just that.
Sandeep Mewara 30-Jul-10 15:59pm    
Reason for my vote of 1
Question not formulated properly. Too less information provided.

1 solution

Hi Connection pooling and timeout expired problem occurs due to database connection not closed properly or poolsize and timeout period not set correctly in the database connection string
make sure you are taking care, the followings for database connection string

1. Close database connections where ever necessary, as due to connection leakages also the connection pool problem will occur
using (SqlConnection sqlConnString = new SqlConnection(ConnectionString))
{
     sqlConnection.Open();
     someCall(sqlConnString);
}


2. Increase the pool size, default maxpool size is 100 and minimum pool size is zero, you can increase pool size appropriately

3.Increase Connect timeout for ex Connect Timeout=5 means 5 seconds

Sample connection string for your reference

sqlConnString=integrated security=SSPI;SERVER=YOUR_SERVER;DATABASE=YOUR_DB_NAME;Min Pool Size=5;Max Pool Size=100;Connect Timeout=5;
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900