Timeout expired. The timeout period elapsed prior to completion…

Problem

You receive this error message when your application attempts to call a stored procedure or other external program:

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

Solution

The IDbCommand object has a property called CommandTimeout.  Set that value high enough to exceed the amount of time required to execute your query or database stored procedure.  You may need to adjust this time out parameter on an application-by-application basis.

Note: you may also need to increase the amount of time that ASP.NET wait for the query to run before throwing an exception.  This is different from the time the database driver waits on your connection.  Both must be set properly for your query or stored procedure to run.

See Also

Part VII:  Troubleshooting Applications

Application Won’t Run

Application Runs But No Data is Displayed

Application Error Messages