Increase Execution time for Sp in webconfig for time out problem
-
i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??
-
i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??
-
Use in Web.Config like this
Go through this link, You can get good idea about connection strings. connectionstrings[^] P.S: Check why that procedure taking two much time (10 minutes). Happy Coding :)
Regards, Eswar
Thanks for the swift reply.. like this means..how?? because i want syntax...where to add and ahta i have to add i check link given by you...but it has nt mention any where....any thing related to time out
-
Thanks for the swift reply.. like this means..how?? because i want syntax...where to add and ahta i have to add i check link given by you...but it has nt mention any where....any thing related to time out
Mugdha_Aditya wrote:
ike this means..how?? because i want syntax...where to add and ahta i have to add
For Web.Config concept See this http://msdn.microsoft.com/en-us/library/w7w4sb0w(v=VS.80).aspx[^]
Mugdha_Aditya wrote:
i check link given by you...but it has nt mention any where....any thing related to time out
Link is only about connection strings with respect to different databases & different parameters. Are you want sample syntax of web.config file?
-
Mugdha_Aditya wrote:
ike this means..how?? because i want syntax...where to add and ahta i have to add
For Web.Config concept See this http://msdn.microsoft.com/en-us/library/w7w4sb0w(v=VS.80).aspx[^]
Mugdha_Aditya wrote:
i check link given by you...but it has nt mention any where....any thing related to time out
Link is only about connection strings with respect to different databases & different parameters. Are you want sample syntax of web.config file?
i waant to add timeout hours in web config... i want sample for tht... so i can add same thing in my web config for time out
-
i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??
10 minutes? Sounds more to me like you need to refactor/refine your stored procedure and schema a bit. I've written queries that take as long as three seconds, but never *minutes*. Believe me when I say the timeout is the least of your worries.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997 -
10 minutes? Sounds more to me like you need to refactor/refine your stored procedure and schema a bit. I've written queries that take as long as three seconds, but never *minutes*. Believe me when I say the timeout is the least of your worries.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997ok..:( but still how can i add time out time in webconfig
-
i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??
Ummm, I hate to rain on everyones parade here, but changing the timeout in the connection string doesn't work. That's the timeout for the CONNECTION to the database, not the timeout for executing a command on the database. You're looking at CommandTimeout[^]. But, like JSOP said, if you've got a long running query like this, you're best option is to try and improve the query's performance first. Having done that, if still too long, run the query async so your code isn't blocked waiting 10 minutes for the query to return. Look at the
Begin*
methods of the SqlCommand object.A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
ok..:( but still how can i add time out time in webconfig
You can't. That timeout is for connecting to the database, not executing a command on it. See my other post for more info.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
i have store procedure which tooks 10 mints to execute so it will get time out in my application. i think we can set Connection.Timeout in web config. can any one tell me where to set that in web config??
There are two type of timeout which we can use in asp.net- SqlCommand.CommandTimeout = timeout limit for your SQL query. Means, how much time a (eg: SELECT, UPDATE) query can take for its execution. If it exceeds SqlCommand.CommandTimeout, then it stops execution. A command timeout error will occur. SqlConnection.ConnectionTimeout = timeout limit for your connection. Means, how much time your connection object can try to connect. If it exceeds the specified time, it stops connecting. A connection timeout error will occur. HELLO GUY