0

Is there any way to increase the timeout limit of the database command (stored procedure)? I tried to add this in the connection string in web.config, but it doesn't seem to work.

MultipleActiveResultSets=True;Connection Timeout=300

I am currently use EF 4.1 for some stored procedure calls and I am also use the ado.net to call some stored procedures having table-valued parameters as well.

Thanks in advance!

zs2020
  • 53,766
  • 29
  • 154
  • 219

1 Answers1

4

Is it the connection you're timing out on or the execution of the command? It might be the command timing out, which I believe are two different things entirely.

I'm a novice at this but it's my understanding that there's a difference between the connection timeout (how long to wait for a connection to the database - which is likely timing out if there's a problem connecting in general) and a command timeout (how long to wait when executing command). I had some issues on a project executing long-running commands. I think the default was 30 seconds thought it may differ by DB. In that situation, I could set it to a value of 0 and it wouldn't time out. Wondering if this is really the command timeout that you want to increase instead.

I believe you have to set the command timeout on a per-command basis as part of the command. Here's a SO post about that.

Just a thought.

Community
  • 1
  • 1
itsmatt
  • 31,265
  • 10
  • 100
  • 164
  • Yes, I think in my case it should be the command timeout. Since the stored procedure takes a very long time to run. – zs2020 Aug 25 '11 at 20:11