DbCommand.CommandTimeout Property


When overridden in a derived class, gets or sets the wait time (in seconds) before terminating the attempt to execute a command and generating an error.

 abstract property int CommandTimeout { int get(); void set(int value); };
public abstract int CommandTimeout { get; set; }
member this.CommandTimeout : int with get, set
Public MustOverride Property CommandTimeout As Integer

Property Value


The time in seconds to wait for the command to execute.



An ArgumentException is generated if the assigned CommandTimeout property value is less than 0.

Note to implementers, it is recommended that 0 means no timeout.

Applies to

See also