I have a webform I'm trying to run. It has 6 grids each with it own sqldatasource control. The sprocs do some calculations to compare two years of purchases. When I open the page using a DB with a large number of transactions for the two years, I get a server
timeout. Is there anyway to change the timeout or could my issue be with the sqldatasource controls?
Here is the error message:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
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.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation
or the server is not responding.
Jackxxx
Contributor
3060 Points
2788 Posts
Timeout issue
Apr 19, 2012 02:37 AM|LINK
I have a webform I'm trying to run. It has 6 grids each with it own sqldatasource control. The sprocs do some calculations to compare two years of purchases. When I open the page using a DB with a large number of transactions for the two years, I get a server timeout. Is there anyway to change the timeout or could my issue be with the sqldatasource controls?
Here is the error message:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
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.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Jackxxx
Jackxxx
Contributor
3060 Points
2788 Posts
Re: Timeout issue
Apr 19, 2012 02:54 AM|LINK
Is there a way to set the timeout on an sqldatasource control?
My sprocs are taking about 35 to 38 seconds to run, each. There are 6 of them.
Jackxxx
Frank Jiang ...
All-Star
16006 Points
1728 Posts
Microsoft
Re: Timeout issue
Apr 23, 2012 10:47 AM|LINK
Hi,
Try to set SqlCommand.CommandTimeout value to 500. By default,the value is 30 seconds.
or add a Connect Timeout to your connection string:
<add key="ConnectionName" value="server=LocalHost;uid=sa;pwd=;database=DataBaseName;Connect Timeout=200; pooling='true'; Max Pool Size=200"/>
Feedback to us
Develop and promote your apps in Windows Store