"Timeout expired. " when using Fill Method

From: Shawn (Shawn_at_discussions.microsoft.com)
Date: 06/26/04


Date: Fri, 25 Jun 2004 17:19:01 -0700

Once a while, my web application gets this error message:
"System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."

>From the Stack Trace:
[SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.]
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable, IDbCommand command, CommandBehavior behavior)
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

In the webconfig file, I set the timeout = 3600.

Is there anything I should be aware of? The problem is that it works sometimes.

Thanks!

Here is my code: (it's quite simple.)

        Dim myConnection As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("connStr1"))
        Dim myCommand As New SqlCommand
        With myCommand
            .CommandType = CommandType.StoredProcedure
            .CommandText = "dbo.spABC"
            .Connection = myConnection
        End With

        Dim adp As New SqlClient.SqlDataAdapter
        adp.SelectCommand = myCommand
        Dim myTable As New DataTable
        adp.Fill(myTable)



Relevant Pages

  • Re: ExOLEDB SQL bug when dtend - dtstart > 732
    ... in the Exchange server, to limit the search to two years. ... dbParams, Object& executeResult) ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.exchange.development)
  • Re: System.Data.SqlClient.SqlException: Timeout expired.
    ... The timeout period elapsed prior to completion of the ... operation or the server is not responding. ... Please review the stack trace for more information ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ThreadAbortException from DbDataAdapter.Fill
    ... determining what's going on at the server. ... >Int32 startRecord, Int32 maxRecords, String ... >srcTable, IDbCommand command, CommandBehavior behavior) ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SBS Monitoring - The page cannot be displayed
    ... Go to IIS Manager, right click on 'Default Web Site' select 'Properties', click on the 'Advanced' button under 'Web Site'. ... Server Status Report: ... startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ... Monitoring and Reporting taskpad. ...
    (microsoft.public.windows.server.sbs)
  • Re: Sql Ole not connecting
    ... Both the local and Allosaurus remote server are running Sql 7.0. ... > connection scripts on my ASP pages and it works fine. ... > Dim ConnectString, SelectStatement As String ... > startRecord, Int32 maxRecords, String srcTable, IDbCommand command, ...
    (microsoft.public.dotnet.framework.aspnet)