I get a database timeout expired error on my ASP.NET application. What can I do?

I get the following error when my ASP.NET application connects to the MS SQL server:

System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

This error is caused by depleted database connections in the connection pool. To resolve the problem, you should

1) Check your application to make sure all database connections are closed when it is not needed. ASP.NET is supposed to have garbage collector to reclaim unused resource. However, on a busy site, it is likely that the connection pool will run out of connections before garbage collection kicks in.

2) You can raise the connection pool size in the connection string. For example, you can add "Max Pool Size=100" to your connection string to increase the pool size to 100.

Was this answer helpful?

 Print this Article

Also Read

I receive an error when trying to access an ASP.NET page within a subweb. What do I do?

The ASPNet (user as which ASP.NET runs) user permission does not inherit into the subweb....

I get a configuration error when I execute my application in a subdirectory. How do I resolve this?

This error may occur if the application is being run out of a subfolder and the subfolder is not...

I get an error 'A potentially dangerous Request.Form value was detected from the client ' when I hit submit on my ASP.NET Webform. What can I do?

This error is caused by a newly introduced feature of .NET Framework 1.1, called "Request...

How do I connect my ASP.net application to MySQL database?

In general, 2 different methods can be used to connect an ASP.net application to MySQL database....

How do I setup custom error for my ASP.net application?

ASP.net has its own built-in error handling. To set up custom error handling for your ASP.net...