mmalik15
asked on
how to increase sql server connection time out in asp.net using web.config
My stored procedure in the sql server database has long and complex queries and takes a bit of time to generate results and at times my asp.net application times out. I need to increase the 'Connection Timeout' value and wondering if this could be done via connection string present in web.config of the application. I have added the entry in the connection string below and unsure if this is the correct way to add it.
<add name="NES.HiLo.Data.Properties.Settings.HiLoConnectionString" connectionString="server=212.20.237.xxx;database=TKNUAT;user id=tknUser2;Connection Timeout=200;password=xxx" providerName="System.Data.SqlClient" />
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
check with this option in the connection string
Persist Security Info=False;Integrated Security=SSPI;database=nor thwind;ser ver=mySQLS erver;Conn ect Timeout=30
Persist Security Info=False;Integrated Security=SSPI;database=nor
And see here that you can't do it using web.config or other configuration;
http://forums.devx.com/showthread.php?147374-Command-Timeout-Option-in-Web.Config
http://stackoverflow.com/questions/1001713/change-the-default-sqlcommand-commandtimeout-with-configuration-rather-than-reco
http://forums.devx.com/showthread.php?147374-Command-Timeout-Option-in-Web.Config
http://stackoverflow.com/questions/1001713/change-the-default-sqlcommand-commandtimeout-with-configuration-rather-than-reco
Could you share as what erro your gettig, the Tiem out may be from IIS on respone to the request from teh client.
In that case you have to specify the request time out in HTTPruntime
<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="3600" />
...
</system.web>
check this blog for better understanding
http://www.telerik.com/help/aspnet-ajax/upload-uploading-large-files.html
In that case you have to specify the request time out in HTTPruntime
<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="3600" />
...
</system.web>
check this blog for better understanding
http://www.telerik.com/help/aspnet-ajax/upload-uploading-large-files.html
Could you share as what erro your gettig, the Tiem out may be from IIS on respone to the request from teh client.
In that case you have to specify the request time out in HTTPruntime
<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="3600" />
...
</system.web>
check this blog for better understanding
http://www.telerik.com/help/aspnet-ajax/upload-uploading-large-files.html
In that case you have to specify the request time out in HTTPruntime
<system.web>
<httpRuntime maxRequestLength="102400" executionTimeout="3600" />
...
</system.web>
check this blog for better understanding
http://www.telerik.com/help/aspnet-ajax/upload-uploading-large-files.html
madgino has posted the only correct solution:
I think you have to modify SqlCommand.CommandTimeout rather than ConnectionTimeout, and you have to do this in code
I think you have to modify SqlCommand.CommandTimeout rather than ConnectionTimeout, and you have to do this in code
Persist Security Info=False;Integrated Security=SSPI;database=nor