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!

0

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I think in my case it should be the command timeout. Since the stored procedure takes a very long time to run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.