DataContext.CommandTimeout 属性

定义

获取或设置一个值,该值增大查询的超时期限(以秒为单位),如果不增大则会在默认超时期限间出现超时。Gets or sets a value that increases the time-out period (in seconds) for queries that would otherwise time out during the default time-out period.

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

属性值

Int32

一个整数值,该值增加了在默认超时期限内将会超时的查询的超时时间段(以秒为单位) () 。An integer value that increases the time-out period (in seconds) for queries that would otherwise time out during the default time-out period.

注解

此属性获取或设置命令超时 ((秒)) 用于执行 () 生成的命令 IDbCommandsThis property gets or sets the command time-out (in seconds) used to execute generated commands (IDbCommands). 有关详细信息,请参阅 CommandTimeoutFor more information, see CommandTimeout.

如果未设置此属性,则的默认值 CommandTimeout 将用于执行查询命令。When this property is not set, the default value of CommandTimeout is used for query command execution. 此默认值是由存储提供程序设置的。This default value is set by the storage provider. 请注意,如果此值设置为非零值,则某些提供程序可能会引发异常。Note that some providers may throw exceptions if this value is set to a non-zero value.

适用于