SessionStateSection.SqlCommandTimeout 属性
定义
获取或设置使用 SQL Server 会话状态模式的 SQL 命令的超时时间。Gets or sets the duration time-out for the SQL commands using the SQL Server session state mode.
public:
property TimeSpan SqlCommandTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("sqlCommandTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public TimeSpan SqlCommandTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanSecondsOrInfiniteConverter))>]
[<System.Configuration.ConfigurationProperty("sqlCommandTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.SqlCommandTimeout : TimeSpan with get, set
Public Property SqlCommandTimeout As TimeSpan
属性值
SQL 命令超时之前的时间量(以秒为单位)。默认值为30秒。The amount of time, in seconds, after which a SQL command will time out. The default is 30 seconds.
- 属性
示例
下面的代码示例演示如何获取 SqlCommandTimeout 属性。The following code example demonstrates how to get the SqlCommandTimeout property. 有关如何访问对象的详细说明,请参阅类主题中的代码示例 SessionStateSection SessionStateSection 。Refer to the code example in the SessionStateSection class topic to learn how to access the SessionStateSection object.
// Display the current SqlCommandTimeout property value.
Console.WriteLine("SqlCommandTimeout: {0}",
sessionStateSection.SqlCommandTimeout);
' Display the current SqlCommandTimeout property value.
Console.WriteLine("SqlCommandTimeout: {0}", _
sessionStateSection.SqlCommandTimeout)