Link to home
Create AccountLog 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
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
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.