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

Rate It (3)

Last post 12-04-2009 4:48 PM by blarticus. 54 replies.

Sort Posts:

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

    06-18-2009, 10:04 AM
    • Member
      2 point Member
    • devaragam
    • Member since 06-18-2009, 2:00 PM
    • Posts 1

    Try This

    Please note the commandTimeout property

    -Prasannakumaran Sarasijanayanan 

     

    Dim ObjConn As System.Data.SqlClient.SqlConnection

    Dim Dt As New Data.DataTable ObjConn = New Data.SqlClient.SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings.Item("Connectionstring").ConnectionString)

    If ObjConn.State = Data.ConnectionState.Closed Then

    ObjConn.Open()

    End If

    Dim Da As New Data.SqlClient.SqlDataAdapter("SELECT * FROM...", ObjConn)

    Da.SelectCommand.CommandTimeout = 3000

    Da.Fill(Dt)

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

    07-16-2009, 5:48 PM
    • Member
      24 point Member
    • navyjax2
    • Member since 04-18-2007, 5:33 PM
    • Posts 12

    I had this happen to me in SQL Server directly, using Design View on my table.  I could make my change (which was to the width of an nvarchar field), but when I went to save it, that's when I'd get this error.  The table itself wasn't even open when the error occurred, so that wasn't it.  So I tried a SQL query and that worked (ALTER TABLE mytable ALTER COLUMN myColumn nvarchar(newWidth)).  I checked Design View and it showed it worked.  I changed it back to the old value in Design View and tried saving it - same error again.

    I figured it had to do with the fact I have 3 million records and how long it must take to update them all.  I had "Remote query timeout", in the Connections window on the SQL Server Properties dialog, set to 0, which should've meant an unlimited period, but it didn't.  I set this to 1200 and magically it saves my new field width for the column I wanted to change.  Hope this helps someone.

    -Tom

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

    08-19-2009, 5:20 AM
    • Member
      50 point Member
    • hinaAsp.Net
    • Member since 07-21-2009, 6:18 AM
    • India
    • Posts 35

    I wrote Connect Timeout upto 2000 but no change.

    ---
    Hina.

    If my reply helped you, dont forget to mark it as "Answer"
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    08-21-2009, 12:26 PM
    • Member
      2 point Member
    • mdurthaler
    • Member since 01-07-2007, 4:38 PM
    • Posts 1

     The post is 5 years old but I ran into this with a DNN site and there were a few things to correct:

    1) Sign in to Sql 2008 Exp as SA and make sure the timeout is adequate -- it was, at 600 seconds.

    -- I also had a permissions issue with dropping indexes and re-adding them for what I was doing so there was more to do than just this.  This error was the last thing to fix.

    2) Tried the webconfig setting in the connection string but this didn't fly.

    3) I'm working in Visual Studio so I highlighted the connection, selected Modify Connection | Advanced and sure enough ... there's a default timeout set for 15 seconds.

    Having already tested my query for deleting a very huge file, I know it takes just over 2 minutes.  Setting the timeout in visual studio (db connection advanced tab) also for 600 seconds seems to have worked.

    So if anyone else sees this, here's another solution.  A time warp would have been the best answer so that anyone from 2005 forward would have already seen this link. Cool

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

    09-17-2009, 9:12 AM

    WITH (NO LOCK)


    This worked perfectly for me. Thanks :)

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

    09-25-2009, 4:45 PM
    • Member
      4 point Member
    • jaeastman
    • Member since 08-27-2008, 8:18 PM
    • Posts 4

    I'm using VS 2005.  My project incorporates a Business Logic Layer and a Data Access Layer.  The Table Adapter in the DAL is configured to run a stored procedure in SQL Server 2005. If the web application were to run to completion, the stored procedure would add about 500 rows to an existing table in SQL.  When I run the sproc in SQL Server Management Studio, it takes about 45 seconds to complete. When I run my app on localhost, it throws the Timeout exception after 30 seconds.  I've tried all the suggestions posted here (except the WITH (NOLOCK) because the sproc has 20 tables and several subqueries in it) and no matter what I have tried, the exception pops up after 30 seconds. 

    Here's the stack trace & I've highlighted where it blows up:

    [SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +862234
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739110
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
       System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +903
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
       SunwestODSTableAdapters.RentRateTableAdapter.sw_ProcessResidentRentIncreases(Nullable`1 NotificationMonth) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\rentmgmt\86e70563\dc6a7260\App_Code.989tz2lc.4.cs:6276
       RentRateBLL.sw_ProcessResidentRentIncreases(Int32 month) in i:\IT\Applications\Rent Management\RentMgmt\App_Code\BLL\RentRateBLL.cs:89
       ResidentData_CalculateResidentRentIncreases.CalculateRents_Click(Object sender, EventArgs e) in i:\IT\Applications\Rent Management\RentMgmt\ResidentData\CalculateResidentRentIncreases.aspx.cs:27
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

    Help!

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

    10-22-2009, 2:56 PM
    • Member
      2 point Member
    • roopeshcb
    • Member since 10-22-2009, 6:45 PM
    • Posts 1

    Thanks Man, I also got the same issue while running a windows application. After i set command timeout it works fine.

    Roopesh

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

    11-05-2009, 4:53 AM
    • Member
      2 point Member
    • nikunjmochi
    • Member since 07-04-2007, 6:45 AM
    • Posts 6

    Hi,

    set objConnection.CommandTimeout = 0;

    thanks

    nikunj mochi

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

    11-05-2009, 8:14 AM
    • Participant
      886 point Participant
    • Babunareshnarra
    • Member since 07-12-2009, 7:10 AM
    • Hyderabad
    • Posts 179

    can use

    For a command

    Command.CommandTimeout=90//time in sec's

    Globally for the application

    server=server_name;initial catalog=DB Name;connect timeout=45;

    in the connection string section of your config file.


    Regards

    Babu Naresh Narra

    Remember to click “Mark as Answer” on the post If you get answer from my post(s) !
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    12-04-2009, 4:48 PM
    • Member
      2 point Member
    • blarticus
    • Member since 12-04-2009, 4:46 PM
    • Posts 1

    I was having this problem with my own DNN website as well.  This one bit of functionality would spin for about 30 seconds and then throw the good ol SQL timeout exception...

    "The post is 5 years old but I ran into this with a DNN site and there were a few things to correct:

    1) Sign in to Sql 2008 Exp as SA and make sure the timeout is adequate -- it was, at 600 seconds."

    This can be found by logging into your SQL server as SA, right clicking on the root(machine name) and selecting properties...you should see Connections under the 'select a page' menu.  Towards the bottom you will see 'Remote Query timeout (in seconds, 0 = no timeout)

    Mine was indeed set to 600...but was clearly not working...so I set it to 0 and poof!  The problem dissappeared!!

Page 4 of 4 (55 items) < Previous 1 2 3 4