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

Rate It (3)

Last post 11-05-2009 8:14 AM by Babunareshnarra. 53 replies.

Sort Posts:

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

    07-19-2005, 9:41 PM
    • Member
      400 point Member
    • ersheido
    • Member since 02-25-2003, 8:51 AM
    • Posts 102
    I just started to get the above error all of a sudden during the bulk import.  I was importing pictures all day and all of a sudden, I started getting this error message and I cannot import a single picture any more.  My web application timeout is set to 3000, but it times in less than a minute.  The culprit seems to be the AddPhoto function.  I restarted SQL Server 2000, IIS, and the whole machine, but to no avail.  There's no code change since it was working earlier in the day.  Any ideas?

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    The statement has been terminated.

    Source Error:

    Line 125:        command.Parameters.Add(New SqlParameter("@BytesPoster", ResizeImageFile(BytesOriginal, 198)))
    Line 126:        command.Parameters.Add(New SqlParameter("@BytesThumb", ResizeImageFile(BytesOriginal, 100)))
    Line 127:        command.ExecuteNonQuery()
    Line 128:    End Sub
    
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    07-28-2005, 3:22 PM
    • Member
      400 point Member
    • ersheido
    • Member since 02-25-2003, 8:51 AM
    • Posts 102
    I forced a close of the connection and it seems to resolve the problem.
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    08-16-2005, 11:48 AM

    Hi,

    I am also getting the same error. Time out expired. the timeout period elpased prior to the completion of the operation.....

    Actually, I am trying to run a data migration tool to transfer the data from one big table to multiple tables...

    there are around 5000-10000 records.... the program starts giving error after some 3000 records... and then it does not migrate even a single record if I start the tool again..

    I have tried everything... checkin the locks.... blocking.... connection pooling... etc etc...

    but nothing seems to be working

    Please help me in this...

    Thanks in advance..

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

    08-16-2005, 5:20 PM
    • Member
      400 point Member
    • ersheido
    • Member since 02-25-2003, 8:51 AM
    • Posts 102
    I'm back to where I started with this.  After implementing the manual closing of the connections, I got a few more uploads in, but now I'm stuck again.  There's something fundementally wrong with this...
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    08-18-2005, 12:34 PM
    • Contributor
      2,125 point Contributor
    • drock22
    • Member since 09-25-2003, 9:21 AM
    • Posts 476
    I'm getting the same problems.....I even set the

    CommandTimeout = 120 in the connection string and it still gets the error

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

    08-18-2005, 2:59 PM
    • Contributor
      2,125 point Contributor
    • drock22
    • Member since 09-25-2003, 9:21 AM
    • Posts 476
    Try adding a Connect Timeout in the web.config

    <add key="DBConnection" value="server=LocalHost;uid=sa;pwd=;database=DataBaseName;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>

    Please reply back if this works....

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

    08-18-2005, 3:19 PM
    • Member
      400 point Member
    • ersheido
    • Member since 02-25-2003, 8:51 AM
    • Posts 102
    Same results for me.
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    08-18-2005, 3:32 PM
    • Contributor
      2,125 point Contributor
    • drock22
    • Member since 09-25-2003, 9:21 AM
    • Posts 476
    Did you set the CommandTimeout  in your code behind also when you call the connection string...
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    08-18-2005, 4:01 PM
    • Member
      400 point Member
    • ersheido
    • Member since 02-25-2003, 8:51 AM
    • Posts 102

    Well, I had not set it, but now that I have it seems to work.  What's taking so long to process these requests?  Do you think it's related to database optimization problems?

    In any case, thanks a lot for your help.  It's a relief to have the Import capability back in action.

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

    08-18-2005, 4:03 PM
    • Contributor
      2,125 point Contributor
    • drock22
    • Member since 09-25-2003, 9:21 AM
    • Posts 476
    I would run your SQL in query analizer and see how many seconds it takes for each set.  Then debug your code from there to see if you have any issues elsewhere.  For me it was the SP, running 45 seconds.... 
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    09-21-2005, 8:33 AM
    • Member
      406 point Member
    • hemant_vikram
    • Member since 08-14-2004, 3:19 AM
    • Pondicherry
    • Posts 136

    Hai ......,

                   I 'm also getting the same problem. I 'm inserting 5 records to 4 tables (2 in 1 table and then 1 each in other tables). When trying to insert the 2nd record to the table, I get this error. How can I solve this problem.

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

    12-01-2005, 8:25 AM
    • Member
      5 point Member
    • Flyingbull
    • Member since 12-01-2005, 1:19 PM
    • Posts 1
    I don't know if you still have this problem or not, but I had it, and finially solved it.  When you read the documentation, if you set the CommandTimeout on the connection object it is NOT inherited by the command object.  You have to set the commandtimeout property of the SQLdata adapter, in the Select Command subset property.  I set it to zero, this means it will wait until it is done. This could mean a long wait for anyone waiting on the data, so you might not want to set it zero like I did.

    Thanks -

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

    02-27-2007, 3:56 AM
    • Member
      12 point Member
    • sherryLes
    • Member since 07-27-2006, 5:31 AM
    • India
    • Posts 8

    Hi

    Same as Michael White.

    Solved it by setting the timeout property to command object
     

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

    03-08-2007, 12:55 PM
    • Member
      188 point Member
    • spfeiffer13
    • Member since 10-20-2004, 11:56 AM
    • Phoenix
    • Posts 49

     I'm having the same problem but I'm trying to edit someone elses code.  Can anyone help me with this?  Where would I set the connection timeout to 0 in the function below? 

    Thanks...

     

     

    Private Function Data2Array() As Array
            Try
                If (dbConnection.State = ConnectionState.Closed) Then dbConnection.Open()
    
    
                'select count(*) from TimesheetStudentActions where stuAction='feedback'
                Dim dTable As New DataTable("temp")
                Dim dtAdapter As New SqlDataAdapter("SELECT  SECTIONID,SCHLSTUID,convert(varchar(10),cast(DAYACCESSED as dateTime),101), " & _
                " ACTIONID, DATEPART(ww,convert(varchar(10),cast(DAYACCESSED as dateTime),101)) WeekOfYear, " & _
                " DATEPART(dw,convert(varchar(10),cast(DAYACCESSED as dateTime),101)) DayOfWeek FROM " & _
                " TimesheetStudentActions WHERE stuAction <> 'feedback' AND  IsNull(ynPROCESSED,0) = 0 AND SCHLSTUID IN (SELECT SCHLSTUID From TimesheetStudent)", dbConnection)
                dtAdapter.Fill(dTable)
    
                Dim intArraycounterMax As Integer = dTable.Rows.Count - 1
                Dim intFieldcounterMax As Integer = dTable.Columns.Count - 1
                Dim intFieldcounter As Integer
                Dim MyArray(intArraycounterMax, intFieldcounterMax) As String
                Dim intarraycounter As Integer = 0
                Dim dRow As DataRow
                For Each dRow In dTable.Rows
                    For intFieldcounter = 0 To intFieldcounterMax
                        Try
                            MyArray(intarraycounter, intFieldcounter) = dRow(intFieldcounter)
                        Catch ex1 As InvalidCastException
                            ' Nothing to do Nulls are ok 
                        Finally
                        End Try
                    Next
                    intarraycounter += 1
                Next
                Return (MyArray)
            Catch ex As Exception
                WriteToLogFile("Exception: " + ex.Message + ex.StackTrace, sImportErrorFile)
            Finally
                If Not (dbConnection Is Nothing) Then
                    If (dbConnection.State = ConnectionState.Open) Then
                        dbConnection.Close()
                    End If
                End If
            End Try
        End Function
     
  • Re: Error: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

    03-19-2007, 2:30 PM
    • Member
      2 point Member
    • npereira
    • Member since 03-19-2007, 6:23 PM
    • Posts 1

    The solution is simple, change the CommandTimeout property of your SqlCommand object.

     The Connect Timeout attribute of a connection string determines how long a SqlConnection Object runs before it stops attempting to connect to a server.

     

    -Nuno

Page 1 of 4 (54 items) 1 2 3 4 Next >