Hello all, i have this query that i have stored as a function on the db and call it via sqldatasource. The query is big and works in the test environment but not in ptoduction, it produces no timeout error message it just doesnt render the grid at all (which
is a Radgrid BTW). This is what i've done so far. The query works i tested it on management studio on the production machine although it took 44 seconds, it did compile. Any ideas/Help appreciated!
thanks for the suggestion, still didnt work....I did however disabled my loading panel and now i am recieving an error.
The wait operation timed out
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
About your problem,please try to set your Command Timeout in entity framework,just like below:
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
public class YourContext : DbContext
{
public YourContext()
: base("YourConnectionString")
{
// Get the ObjectContext related to this DbContext
var objectContext = (this as IObjectContextAdapter).ObjectContext;
// Sets the command timeout for all the commands
objectContext.CommandTimeout = 120;
}
}
thanks for the reponse apparently the issue was with the database for the tables affected were not indexed....thanks for the help i will reference your suggested code
Member
36 Points
211 Posts
Query timeout but no error?
Apr 24, 2014 01:54 AM|kristofour|LINK
Hello all, i have this query that i have stored as a function on the db and call it via sqldatasource. The query is big and works in the test environment but not in ptoduction, it produces no timeout error message it just doesnt render the grid at all (which is a Radgrid BTW). This is what i've done so far. The query works i tested it on management studio on the production machine although it took 44 seconds, it did compile. Any ideas/Help appreciated!
in the connnection string of the webconfig i added..
Connection Timeout=60
commandtimeout
Star
13653 Points
5480 Posts
Re: Query timeout but no error?
Apr 24, 2014 02:36 AM|Ashim Chatterjee|LINK
Hello,
Apart from your web.config.Assuming you deployed using iis, you may have to change the timeout settings from iis also.Like Below:
commandtimeout
Member
36 Points
211 Posts
Re: Query timeout but no error?
Apr 24, 2014 09:33 AM|kristofour|LINK
thanks for the suggestion, still didnt work....I did however disabled my loading panel and now i am recieving an error.
The wait operation timed out
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The wait operation timed out
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
commandtimeout
All-Star
16806 Points
2777 Posts
Re: Query timeout but no error?
Apr 25, 2014 03:58 AM|Kevin Shen - MSFT|LINK
Hi kristofour,
About your problem,please try to set your Command Timeout in entity framework,just like below:
Hope it can help you.
Best Regards,
Kevin Shen.
commandtimeout
Member
36 Points
211 Posts
Re: Query timeout but no error?
Apr 28, 2014 11:26 AM|kristofour|LINK
thanks for the reponse apparently the issue was with the database for the tables affected were not indexed....thanks for the help i will reference your suggested code
commandtimeout