Share via


ServerConnection.StatementTimeout 属性

Gets or sets the number of seconds a statement is given to run before failing with a time-out error.

命名空间:  Microsoft.SqlServer.Management.Common
程序集:  Microsoft.SqlServer.ConnectionInfo(在 Microsoft.SqlServer.ConnectionInfo.dll 中)

语法

声明
Public Property StatementTimeout As Integer 
    Get 
    Set
用法
Dim instance As ServerConnection 
Dim value As Integer 

value = instance.StatementTimeout

instance.StatementTimeout = value
public int StatementTimeout { get; set; }
public:
property int StatementTimeout {
    int get ();
    void set (int value);
}
member StatementTimeout : int with get, set
function get StatementTimeout () : int 
function set StatementTimeout (value : int)

属性值

类型:System.Int32
An Int32 value that specifies the number of seconds a statement is given to run before failing with a time-out error.

示例

C#

ServerConnection conn = new ServerConnection();
Console.WriteLine(conn.StatementTimeout);

PowerShell

$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
Write-Host $conn.StatementTimeout

请参阅

参考

ServerConnection 类

Microsoft.SqlServer.Management.Common 命名空间