Link to home
Start Free TrialLog in
Avatar of josephdaviskcrm
josephdaviskcrmFlag for United States of America

asked on

ASP.NET - Set Connection time out in the app settings section of the web.config file.

I have the following in my web.config file.
<appSettings>
</appSettings>

I want to be able to run code like the following in my application...

cmd = New SqlCommand(sqlStr, conn)
cmd.CommandTimeout = Convert.ToInt32(ConfigurationManager.AppSettings("ConnectionTimeout"))
cmd.Connection.Open()
cmd.ExecuteNonQuery()

how do I enter this into the web.config file correctly for say, 90 seconds?
P.S. - ASP.NET 3.5
ASKER CERTIFIED SOLUTION
Avatar of RedKelvin
RedKelvin

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 RedKelvin
RedKelvin

Sorry use 90 instead of 90000, I thought it was milliseconds but it is seconds
Avatar of josephdaviskcrm

ASKER

Cool.  Thanks.