You can clear the pool use the following code. However i suggest you to check the following first 1. Please call the Dispose() method after you close the connection.
2. Ask the DBA to check for open connections at the very moment you are greeted with the error. You could find the faulty application.
3. Check the web.config for the pool settings. Set pooling to true.
Max Pool Size - Leave it at 100
Min Pool Size - Mark it 0
Pooling - Mark to true
4. Note: Restarting the IIS could fix the issue. Because the AppPools would refresh. If all does not work, then do this.
//To clear the specific connection
SqlConnection.ClearPool(SqlConnection conn)
//To clear all pools
SqlConnection.ClearAllPools()
Liked By
Write Answer
maxpool error in the application
Join MindStick Community
You have need login or register for voting of answers or question.
Amit Singh
15-Dec-2010You can clear the pool use the following code. However i suggest you to check the following first
1. Please call the Dispose() method after you close the connection.
2. Ask the DBA to check for open connections at the very moment you are greeted with the error. You could find the faulty application.
3. Check the web.config for the pool settings. Set pooling to true.
Max Pool Size - Leave it at 100
Min Pool Size - Mark it 0
Pooling - Mark to true
4. Note: Restarting the IIS could fix the issue. Because the AppPools would refresh. If all does not work, then do this.
//To clear the specific connection
SqlConnection.ClearPool(SqlConnection conn)
//To clear all pools
SqlConnection.ClearAllPools()