Pages

Saturday, April 26, 2008

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

When accessing a SQL Database from an ASP.NET page, I sometimes get this error:

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

... This seems to be because the SQL Server isn't spun up all the time like Oracle is. So initially after a long pause it seems to take a lot longer to set up again.

There are 2 possibilities here, one is that you are timing out before a connection is made, and the other is that your command is taking too long to execute.

Connect Timeout Set the Connect Timeout to a much higher value, like 120.

ComandTimeout Set the CommandTimeout to a much higher value.

No comments:

Share This!

Contact Us

Name

Email *

Message *