SqlConnection.CommandTimeout Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the default wait time (in seconds) before terminating the attempt to execute a command and generating an error. The default is 30 seconds.
public:
property int CommandTimeout { int get(); };
public int CommandTimeout { get; }
member this.CommandTimeout : int
Public ReadOnly Property CommandTimeout As Integer
Property Value
The time in seconds to wait for the command to execute. The default is 30 seconds.
Remarks
You can set the default wait time by using the Command Timeout
keyword in the connection string. A value of 0 indicates no limit (an attempt to execute a command will wait indefinitely).