Wednesday, April 22, 2009

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


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

Resolution:

  1. SqlConnection: If this happen when tries to connecting to SQL Server, then try increasing the timeout of the connection
    Connection String: server=Server;database=Database;uid=Uid;pwd=Pwd;timeout=600 (ConnectionTimeout is read-only)
  2. SqlCommand: More interestingly if you manage to connect successfully and although you set a fat timeout value to your connection command object does not inherit the timeout from its connection. It uses its own timeout value. More logically ConnectionTimeout and CommandTimeout.   
    So increase the timeout of the command, which is not read-only like SQLConnection

    command.CommandTimeot = 600 (set to 10 minutes)  

Reference: ASP.NET Forums

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...