Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
If your database connection class is the data access application blocks "sqlhelper" or sqlclient class, you may encounter the following timeout exception when performing a very time-consuming SQL operation.
---------------------------
---------------------------
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
---------------------------
OK
---------------------------
You will say that I have set connect timeout = 80000 in the connection string, and the timeout connection in the database is also set to a large value. Why does it still time out after 30 seconds ??
This is because:
There is no problem with your settings. It is because you have confused the differences between sqlcommand. commandtimeout and sqlconnection. connectiontimeout.
The timeout value in your connection string is only the value of sqlconnection. connectiontimeout, not the value of sqlcommand. commandtimeout.
Sqlhelper does not have sqlcommand. commandtimeout settings. You need to set it yourself.
The following are two comparisons:
Sqlcommand. commandtimeout
Obtain or set the wait time before terminating the Command Execution Attempt and generating an error.
The waiting time (in seconds ). The default value is 30 seconds.
Sqlconnection. connectiontimeout
Obtain the time that is waiting before the connection is terminated and an error is generated.
The wait time (in seconds) for the connection to open ). The default value is 15 seconds.
For more detailed descriptions of this problem, see:
Http://www.eggheadcafe.com/PrintSearchContent.asp? Linkid = 357
This problem can be regarded as a problem that cannot be taken into consideration during sqlhelper design.
The default value of sqlcommand. commandtimeout is 30.ProgramThis value is enough. Therefore, sqlhelper has never been detected. I found this problem in sqlhelper only when I got a very long post (nearly 4000 replies) on a relatively poor local machine.