.Net MVC 3 & Entity framework 4.1 timeout expired of executing the database command (stored procedure)
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.
Mul开发者_开发技巧tipleActiveResultSets=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!
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.
精彩评论