Timeout expired......Net SQL Client Data Provider ConnectionRead(WrapperRead())."

  • Hello Guys,

    We are experiencing following SQL error frequently on production server 2000 but we are unable to reproduce it on testing server.

    "Timeout expired. The timeout period elapsed prior to

    completion of the operation or the server is not responding."

    0 " .Net SQL Client Data Provider ConnectionRead (WrapperRead())."

    As there are no additional information in the Errors collection, we are stuck here what will be the probable reasons for occurrence of error. We have searched on net also but not found any satisfactory reasons.

    Pls help us by providing probable solutions to this problem.

    Thanks in advance.

  • Whatever query you called ran longer than 30 sec (or whatever the timeout is set to)

    To fix, you are going to have to identify what query is been called and then ither optimise the query, or increase the connection timeout set in .net.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Query and connection string might not be the problem....because the same code is share between lots of application on another servers and working filne even for larger databases.

  • You need to increase the CommandTimeout of the connection object in your .NET code. The default values is 30 seconds.

    You can increase it up to 3600 seconds (1 hour)

    You can use it as follows:

    SqlCommand cmd = new SqlCommand();

    cmd.CommandTimeout = 3600;

    -----------------------------------------------------------[font=Arial Black]Time Is Money[/font][font=Arial Narrow]Calculating the Number of Business Hours Passed since a Point of Time[/url][/font][font=Arial Narrow]Calculating the Number of Business Hours Passed Between Two Points of Time[/font]

  • I have already set it 0 (i.e unlimited)....

  • Did that problem got resolved by setting timeout to 0(unlimited)?

    Sorry asking quiet late.

    MJ

  • This problem is not resolved yet..

  • Did you try setting timeout setting to 1 hour or something apart from 0(i.e. unlimited) as it usually allows the code to give an hung impression to server.

    MJ

  • Yes i had tried this,May be this is a problem of sql server 2000.

  • anurag.sharma (7/20/2008)


    Query and connection string might not be the problem....because the same code is share between lots of application on another servers and working filne even for larger databases.

    are the same database [table(s)] is sharing by multiple applications ???

    kshitij kumar
    kshitij@krayknot.com
    www.krayknot.com

  • No this server is shared by single apllication but on multiuser enviorment, The problem is only with one server. And same code running on different servers are working fine. Might be this is a problem of sql server's dll.

  • Have you tried running the t-sql statament ran by the code on server itself? It will answer your problem whether its timeout settings on >net side that needs to be changed or is it something that is faulty on sql server side.

    MJ

  • query is executing fine on the server, But frequently "TimeOut Expire Bug" is comming.

  • Not Found the solution of this problem yet , Followind code is used

    Public Function fExecuteQueryForDataTable(ByVal sSql As String, ByRef objDataTable As Object) As Boolean

    Dim objConnection As SqlConnection

    Dim objDataAdapter As SqlClient.SqlDataAdapter

    Try

    If Not (gstrDBType = "ORACLE" Or gstrDBType = "SQL") Then

    gstrErrorDesc = "This Application Supports ORACLE And SQL."

    Exit Function

    End If

    objConnection = New SqlClient.SqlConnection(gstrADONETConnString)

    objConnection.Open()

    If objConnection.State ConnectionState.Open Then

    gstrErrorDesc = LoadResString(2032)

    Exit Function

    End If

    objDataAdapter = New SqlDataAdapter(sSql, objConnection)

    objDataAdapter.SelectCommand.CommandTimeout = 0

    objDataTable = New DataTable

    objDataAdapter.Fill(objDataTable)

    fExecuteQueryForDataTable = True

    Catch ex As Exception

    gstrErrorDesc = ex.Message

    fExecuteQueryForDataTable = False

    Finally

    If objConnection.State ConnectionState.Closed Then

    If Not IsNothing(objDataAdapter) Then

    objDataAdapter.Dispose()

    End If

    objConnection.Close()

    objConnection.Dispose()

    End If

    objDataAdapter = Nothing

    objConnection = Nothing

    End Try

    End Function

Viewing 15 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply