C # "Timeout expired. The timeout period elapsed or the server does not respond before the operation is completed."

There are two general we place a second, to take a first default, but when the query is relatively large (code optimization difference) data, will be more than 30 seconds to form a given

 

SqlCommand.CommandTimeout
Gets or sets the wait time before terminating the attempt to execute a command and generating an error.
Time waits for command execution (in seconds). The default is 30 seconds.


SqlConnection.ConnectionTimeout
get in trying to establish a connection terminating the attempt and generating an error before the time to wait.
Connection open waiting time (in seconds). The default is 15 seconds.

 

Guess you like

Origin www.cnblogs.com/XiaoHongMao1/p/11609079.html