.NET : The timeout period elapsed prior to completion

Published by

Posted on April 30, 2012

Error:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
 

The timeout is caused by the length of time it is taking your application to complete the process. You can try changing your SQL Query or updating the connection string to include a longer timeout. The default timeout for .net is 30 seconds.

 

The following articles may assist you with correcting the issue.

http://codebetter.com/petervanooijen/2006/03/20/timeout-on-a-sql-database-sqlconnection-connectiontimeout-and-sqlcommand-commandtimeout/

Microsoft
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout.aspx
http://blogs.msdn.com/b/spike/archive/2008/07/31/timeout-expired-the-timeout-period-elapsed-prior-to-completion-of-the-operation-or-the-server-is-not-responding.aspx