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. Web Development
  3. ASP.NET
  4. Timeout Expired" message when executing program with SQL database call

Timeout Expired" message when executing program with SQL database call

Scheduled Pinned Locked Moved ASP.NET
databasehelpcsharp
2 Posts 2 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
    smita_roy
    wrote on last edited by
    #1

    Hi, I have a C# program that I am using to access a SQL database. The problem is one of the queries takes a reasonable long time (about 5mins in SQL query analyzer), but when I run my program it keeps throwing an exception of "Timeout Expired" I thought that by increasing the "Connect Timeout=600" to 600 would cure it but it doesn't. Help!

    R 1 Reply Last reply
    0
    • S smita_roy

      Hi, I have a C# program that I am using to access a SQL database. The problem is one of the queries takes a reasonable long time (about 5mins in SQL query analyzer), but when I run my program it keeps throwing an exception of "Timeout Expired" I thought that by increasing the "Connect Timeout=600" to 600 would cure it but it doesn't. Help!

      R Offline
      R Offline
      Rhys Gravell
      wrote on last edited by
      #2

      Are you using the SqlCommand object? A SqlCommand object has a CommandTimeout property which is independant of the "Connect Timeout" property in the connection string which I believe defaults to 30 seconds. If you are using a SqlCommand, change this property as wel as that in the connection string. Rhys The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense Edsgar Dijkstra If life were fair, Dan Quayle would be making a living asking 'Do you want fries with that?' John Cleese

      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