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. General Programming
  3. C#
  4. sql timeout

sql timeout

Scheduled Pinned Locked Moved C#
databasecsharphelp
6 Posts 3 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.
  • J Offline
    J Offline
    JacquesDP
    wrote on last edited by
    #1

    Hi all. When I execute a simple sql command through my C# app, I get an error that says that an sql timeout has occured. When I run the exact same command through query analizer it takes about 8 seconds to complete and returns all rows. Does anyone have an idea why this happens. I have set the connection time out to 30 seconds and then to 60 seconds and I still recieve the same error. Thanx in advance

    He who laughs last is a bit on the slow side

    B J 2 Replies Last reply
    0
    • J JacquesDP

      Hi all. When I execute a simple sql command through my C# app, I get an error that says that an sql timeout has occured. When I run the exact same command through query analizer it takes about 8 seconds to complete and returns all rows. Does anyone have an idea why this happens. I have set the connection time out to 30 seconds and then to 60 seconds and I still recieve the same error. Thanx in advance

      He who laughs last is a bit on the slow side

      B Offline
      B Offline
      Baj22
      wrote on last edited by
      #2

      I'm sure I'm not the best expert on this, but the first two things I would do are: 1) double check your connection string in the app 2) check out the resources that your app is using, potentially it could be hogging everything so that sql server runs more slowly and times out hope those help or that someone else can give you the real low down ~A

      J 1 Reply Last reply
      0
      • B Baj22

        I'm sure I'm not the best expert on this, but the first two things I would do are: 1) double check your connection string in the app 2) check out the resources that your app is using, potentially it could be hogging everything so that sql server runs more slowly and times out hope those help or that someone else can give you the real low down ~A

        J Offline
        J Offline
        JacquesDP
        wrote on last edited by
        #3

        Thanx for the reply, I know the connection is fine, when I step through it, it loads all the values into my dataset, then I loop through the dataset and populate a listview. The first time I run the app it will populate the listview with lets say 20 entries, the second time it will populate the list view with 80 entries. The problem being that its with the exact same operation and I can't think that the app uses that much resources, or should I say I rather hope not. Once again many thanx for the quick reply.

        He who laughs last is a bit on the slow side

        1 Reply Last reply
        0
        • J JacquesDP

          Hi all. When I execute a simple sql command through my C# app, I get an error that says that an sql timeout has occured. When I run the exact same command through query analizer it takes about 8 seconds to complete and returns all rows. Does anyone have an idea why this happens. I have set the connection time out to 30 seconds and then to 60 seconds and I still recieve the same error. Thanx in advance

          He who laughs last is a bit on the slow side

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          I will hazard a guess based on my experience of the exact same thing. here goes: You have set the connection timeout in the connections string to 30 (or 60) seconds and not the Command timeout which is set on the relevant Command object.

          --- How to get answers to your questions[^]

          J 2 Replies Last reply
          0
          • J J4amieC

            I will hazard a guess based on my experience of the exact same thing. here goes: You have set the connection timeout in the connections string to 30 (or 60) seconds and not the Command timeout which is set on the relevant Command object.

            --- How to get answers to your questions[^]

            J Offline
            J Offline
            JacquesDP
            wrote on last edited by
            #5

            J4amieC wrote:

            How to get answers to your questions[^]

            I'm sorry if I posted this under the wrong discussion. Seeing as I thought it wasn't a sql problem I thought it might be a problem within my code. I removed the timeout on the connection, but still recieve the timeout error. I will look into the Command timeout.

            J4amieC wrote:

            Command timeout which is set on the relevant Command object.

            With that I asume you are talking about the sql command object, such as the select statement.? Many thanx for the reply

            He who laughs last is a bit on the slow side

            1 Reply Last reply
            0
            • J J4amieC

              I will hazard a guess based on my experience of the exact same thing. here goes: You have set the connection timeout in the connections string to 30 (or 60) seconds and not the Command timeout which is set on the relevant Command object.

              --- How to get answers to your questions[^]

              J Offline
              J Offline
              JacquesDP
              wrote on last edited by
              #6

              The connection previously were created using sa, the sql system administrator. I changed that to a different user to login into the database, and from there it all went wrong, can it be anything with that, the user I created also has all adminitrator rights. Unfortunatily I'm not much of a sql fundu, still have alot to learn.

              He who laughs last is a bit on the slow side

              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