jra2002
asked on
System.Data.SqlClient.SqlException: Timeout expired
I am getting the following exception -
System.Data.SqlClient.SqlE xception: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
at System.Data.SqlClient.SqlC ommand.Exe cuteNonQue ry()
On the google I found I need to update the commandTimeOut property. How much do I need to update it and where should I update it.
My application is windows application
Thanks
System.Data.SqlClient.SqlE
at System.Data.SqlClient.SqlC
On the google I found I need to update the commandTimeOut property. How much do I need to update it and where should I update it.
My application is windows application
Thanks
ASKER
Dear John,
previously I had never has the problem of Timeout Today is the first tine I am getting this error
Thanks
previously I had never has the problem of Timeout Today is the first tine I am getting this error
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear Arragorn
You are right. It's not the program error. Database is locked
You are right. It's not the program error. Database is locked
I am experiencing the same problem, but it is not timing out from Query Analyzer, only from the app. I have cmd.CommandTimeout = 600 in the class. The server is config'd for the same. But the app times out after 25 sec. What gives?
You can change the the timeout period by setting the CommandTimeout property of your command object. This property is in seconds. For Example to set your timeout property to 2 mins (120 secs)
EX:
dim myCmd as SQLCommand
myCmd.CommandTimeout = 120
To determine what to set the timeout to it is important to know why the timeout is occuring. Is this a long running query etc.
John Crenshaw
john.crenshaw@ky.gov
john@jcdl.net
Consultants are people who borrow your watch to tell you what time it is, then walk off with the watch.