locked
System.Data.SqlClient.SqlException Connection Timeout Expired RRS feed

  • Question

  • Dear ALL;

    Sometimes I found the following error. Please advise...

    Exception information:

        Exception type: System.Data.SqlClient.SqlException

        Exception message: Connection Timeout Expired.  The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement.  This could be because the pre-login handshake failed or the server was unable to respond back in time.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=11277; handshake=0;

    Inner exception information (level 1):

    Exception type: System.ComponentModel.Win32Exception

    Exception message: The wait operation timed out

    Muhammad Makhaly [url]http://www.makhaly.net[/url]

    Tuesday, January 7, 2014 1:28 PM

Answers

  • This is a generic .Net login timeout.  There can be many reasons of getting timeout.  Timeout can be due to connection timeout, command timeout, network congestion etc.

    My suggestion is to increase the connection timeout in your application.                      
    Refer:http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout(v=vs.110).aspx

    • Proposed as answer by Ch. Rajen Singh Thursday, January 9, 2014 4:03 AM
    • Edited by Ch. Rajen Singh Tuesday, January 14, 2014 10:26 AM txt change
    • Marked as answer by Elvis Long Wednesday, January 15, 2014 2:15 AM
    Tuesday, January 7, 2014 3:02 PM
    Answerer

All replies

  • Which SQL version you are using?

    I would also suggest if your SQL server is not  upgraded  with latest SP then upgrade it.

    • Proposed as answer by JLighting11 Tuesday, September 9, 2014 5:48 PM
    Tuesday, January 7, 2014 1:41 PM
  • Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Standard Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)


    Muhammad Makhaly [url]http://www.makhaly.net[/url]

    Tuesday, January 7, 2014 1:47 PM
  • This is a generic .Net login timeout.  There can be many reasons of getting timeout.  Timeout can be due to connection timeout, command timeout, network congestion etc.

    My suggestion is to increase the connection timeout in your application.                      
    Refer:http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout(v=vs.110).aspx

    • Proposed as answer by Ch. Rajen Singh Thursday, January 9, 2014 4:03 AM
    • Edited by Ch. Rajen Singh Tuesday, January 14, 2014 10:26 AM txt change
    • Marked as answer by Elvis Long Wednesday, January 15, 2014 2:15 AM
    Tuesday, January 7, 2014 3:02 PM
    Answerer
  • Some time this kind of issue comes when there is memory leak at application level.

    First I would like to suggest to update your SQL instance with SP2.

    If still issue is there then share the SQL log before this comes also check wait state for bulk transaction at that time, because some thing you executed in bulk as below error message you specified

    Exception type: System.ComponentModel.Win32Exception

    Exception message: The wait operation timed out

    Wednesday, January 8, 2014 8:14 AM