DbCommand.CommandTimeout Property

定义

获取或设置在终止执行命令的尝试并生成错误之前的等待时间。 Gets or sets the wait time before terminating the attempt to execute a command and generating an error.

public abstract int CommandTimeout { get; set; }
属性值

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

实现

注解

ArgumentException如果生成已分配CommandTimeout属性值小于 0。An 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.

适用于