ServerConnection.StatementTimeout 屬性
取得或設定陳述式因為逾時錯誤而失敗之前可以執行的秒數。
命名空間: 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)
屬性值
型別:Int32
Int32 值,指定陳述式因為逾時錯誤而失敗之前可以執行的秒數。
範例
C#
ServerConnection conn = new ServerConnection();
Console.WriteLine(conn.StatementTimeout);
PowerShell
$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
Write-Host $conn.StatementTimeout