Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Timeout expired

Timeout expired

Scheduled Pinned Locked Moved Database
helpcsharpdatabasesysadmin
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Senu Gandhi
    wrote on last edited by
    #1

    I am working on .Net 2.0 and SQL 2000. While running my application, during dataset fill I get the following error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding" I tried setting connection timeout to 0 and command timeout to 0. This is the code: public DataSet FillDatasetSQL(string strQuery) { try { //-----Connection open sqlConn = new SqlConnection(strSqlConn); sqlConn.Open(); //-----Fill Dataset DataSet ds = new DataSet(); sqlAdap = new SqlDataAdapter(strQuery, sqlConn); sqlAdap.Fill(ds, "Tablename"); <=========== error occurs here //-----Connection close sqlConn.Close(); sqlConn.Dispose(); return ds; } catch(Exception ex) { if (sqlConn.State == ConnectionState.Open) sqlConn.Close(); sqlConn.Dispose(); throw ex; } } Please help Senthil

    N R G 3 Replies Last reply
    0
    • S Senu Gandhi

      I am working on .Net 2.0 and SQL 2000. While running my application, during dataset fill I get the following error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding" I tried setting connection timeout to 0 and command timeout to 0. This is the code: public DataSet FillDatasetSQL(string strQuery) { try { //-----Connection open sqlConn = new SqlConnection(strSqlConn); sqlConn.Open(); //-----Fill Dataset DataSet ds = new DataSet(); sqlAdap = new SqlDataAdapter(strQuery, sqlConn); sqlAdap.Fill(ds, "Tablename"); <=========== error occurs here //-----Connection close sqlConn.Close(); sqlConn.Dispose(); return ds; } catch(Exception ex) { if (sqlConn.State == ConnectionState.Open) sqlConn.Close(); sqlConn.Dispose(); throw ex; } } Please help Senthil

      N Offline
      N Offline
      Nic Rowan
      wrote on last edited by
      #2

      How and where did you try set the command timeout? Did you try set it in the connection string or did you do something like: sqlAdap = new SqlDataAdapter(strQuery, sqlConn); **sqlAdap.SelectCommand.CommandTimeout = 120;** sqlAdap.Fill(ds, "Tablename");


      Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it.


      S 1 Reply Last reply
      0
      • S Senu Gandhi

        I am working on .Net 2.0 and SQL 2000. While running my application, during dataset fill I get the following error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding" I tried setting connection timeout to 0 and command timeout to 0. This is the code: public DataSet FillDatasetSQL(string strQuery) { try { //-----Connection open sqlConn = new SqlConnection(strSqlConn); sqlConn.Open(); //-----Fill Dataset DataSet ds = new DataSet(); sqlAdap = new SqlDataAdapter(strQuery, sqlConn); sqlAdap.Fill(ds, "Tablename"); <=========== error occurs here //-----Connection close sqlConn.Close(); sqlConn.Dispose(); return ds; } catch(Exception ex) { if (sqlConn.State == ConnectionState.Open) sqlConn.Close(); sqlConn.Dispose(); throw ex; } } Please help Senthil

        R Offline
        R Offline
        r a j u u
        wrote on last edited by
        #3

        I think no need to set connection timeout=0 and Cammand timeout=0.. plz check the connection string and type the following code in web.config not sure..try this...

        Rajendran

        R 1 Reply Last reply
        0
        • R r a j u u

          I think no need to set connection timeout=0 and Cammand timeout=0.. plz check the connection string and type the following code in web.config not sure..try this...

          Rajendran

          R Offline
          R Offline
          r a j u u
          wrote on last edited by
          #4

          better give commandtimeout=100(some avlue) it will work

          Rajendran

          S 1 Reply Last reply
          0
          • N Nic Rowan

            How and where did you try set the command timeout? Did you try set it in the connection string or did you do something like: sqlAdap = new SqlDataAdapter(strQuery, sqlConn); **sqlAdap.SelectCommand.CommandTimeout = 120;** sqlAdap.Fill(ds, "Tablename");


            Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it.


            S Offline
            S Offline
            Senu Gandhi
            wrote on last edited by
            #5

            Thanks for your reply. You are right. I too tried the same what u said. But it doesn't work out well. Senthil

            N 1 Reply Last reply
            0
            • R r a j u u

              better give commandtimeout=100(some avlue) it will work

              Rajendran

              S Offline
              S Offline
              Senu Gandhi
              wrote on last edited by
              #6

              Thanks for your reply. I had tried this already. but no use. One more information I am using 2 connections 1 for Insert / Update / Delete with transaction 1 for Select without transaction I suspect whether it is a deadlock Senthil

              1 Reply Last reply
              0
              • S Senu Gandhi

                Thanks for your reply. You are right. I too tried the same what u said. But it doesn't work out well. Senthil

                N Offline
                N Offline
                Nic Rowan
                wrote on last edited by
                #7

                How much data are you trying to bring back? It might be that the sql statement is running fine but it's timing out trying to fill the dataset. If you run the SQL statement in Query Analyser or Management Studio, how many rows do you get back and how big (data wise) are the rows?


                Dad always thought laughter was the best medicine, which I guess is why several of us died of tuberculosis. I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it.


                1 Reply Last reply
                0
                • S Senu Gandhi

                  I am working on .Net 2.0 and SQL 2000. While running my application, during dataset fill I get the following error "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding" I tried setting connection timeout to 0 and command timeout to 0. This is the code: public DataSet FillDatasetSQL(string strQuery) { try { //-----Connection open sqlConn = new SqlConnection(strSqlConn); sqlConn.Open(); //-----Fill Dataset DataSet ds = new DataSet(); sqlAdap = new SqlDataAdapter(strQuery, sqlConn); sqlAdap.Fill(ds, "Tablename"); <=========== error occurs here //-----Connection close sqlConn.Close(); sqlConn.Dispose(); return ds; } catch(Exception ex) { if (sqlConn.State == ConnectionState.Open) sqlConn.Close(); sqlConn.Dispose(); throw ex; } } Please help Senthil

                  G Offline
                  G Offline
                  GuyThiebaut
                  wrote on last edited by
                  #8

                  I just want to double check with you that you have done everything you need to do. So here is an example from my own code that works:

                  oconn.ConnectionTimeout = 0
                  oconn.CommandTimeout = 0
                  oconn.Open "Driver={SQL Server};Server=Hal2000;Database=Europa;Uid=sa; Pwd= :P ;timeout=0;"
                  

                  One final thing do you need to set up an ODBC connection on the computer, and if you do have you set this up?

                  You always pass failure on the way to success.
                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups