DbCommand.CommandTimeout 属性

定义

在派生类中重写时,获取或设置在终止尝试执行命令并生成错误之前的等待时间(以秒为单位)。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.

public:
 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

属性值

等待命令执行所需的时间(以秒为单位)。The time in seconds to wait for the command to execute.

实现

注解

如果分配的 CommandTimeout 属性值小于0,则将生成 ArgumentExceptionAn ArgumentException is generated if the assigned CommandTimeout property value is less than 0.

请注意,对于实现者,建议0表示没有超时。Note to implementers, it is recommended that 0 means no timeout.

适用于

另请参阅