Link to home
Start Free TrialLog in
Avatar of mmalik15
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"  />

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of madgino
madgino
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of santhimurthyd
check with this option in the connection string

Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer;Connect Timeout=30
check with this option in the connection string

Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer;Connect Timeout=30
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
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
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