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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Sql Timeout Error

Sql Timeout Error

Scheduled Pinned Locked Moved C#
databasecsharphelp
3 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.
  • A Offline
    A Offline
    ayuba asia
    wrote on last edited by
    #1

    I have a case which i run the sql statement from my c# application.. becasue the query is big and dont have indexed on the table sometimes i got the timeout error how so i set the timeout period.. i cannot change the database structure cause is it in use and they dont do want to make any changes to it.. any sugesstion..

    R 1 Reply Last reply
    0
    • A ayuba asia

      I have a case which i run the sql statement from my c# application.. becasue the query is big and dont have indexed on the table sometimes i got the timeout error how so i set the timeout period.. i cannot change the database structure cause is it in use and they dont do want to make any changes to it.. any sugesstion..

      R Offline
      R Offline
      rmhewa
      wrote on last edited by
      #2

      Try this. Set the 'CommandTimeOut' of the Connection and the SQLCommand object you r using to execute the sql to 0 (Zero) Rohitha M.Hewa Senior IT Executive Naturub Group of Companies - Sri Lanka

      C 1 Reply Last reply
      0
      • R rmhewa

        Try this. Set the 'CommandTimeOut' of the Connection and the SQLCommand object you r using to execute the sql to 0 (Zero) Rohitha M.Hewa Senior IT Executive Naturub Group of Companies - Sri Lanka

        C Offline
        C Offline
        Colin Angus Mackay
        wrote on last edited by
        #3

        That is dangerous because the application will block until SQL Server returns the answer. You should always put an acceptable upper limit so that control will eventually return to the application.


        My: Blog | Photos "Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius

        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