Avatar of josephdaviskcrm
josephdaviskcrm
Flag 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
.NET ProgrammingASP.NET

Avatar of undefined
Last Comment
josephdaviskcrm

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
RedKelvin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
RedKelvin

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

ASKER
Cool.  Thanks.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes