SqlExecutionException.Server 屬性

定義

取得例外狀況發生時所存取的 SQL Server 執行個體。Gets the SQL Server instance being accessed when the exception occurred.

public:
 property System::String ^ Server { System::String ^ get(); };
public string Server { get; }
member this.Server : string
Public ReadOnly Property Server As String

屬性值

例外狀況發生時所存取的 SQL Server 執行個體名稱。The name of the SQL Server instance being accessed when the exception occurred.

範例

下列程式碼範例顯示如何存取Server SqlExecutionException例外狀況類型的屬性。The following code example shows how to access the Server property of the SqlExecutionException exception type. 這個程式碼範例是針對SqlServices類型提供之較大範例的一部分。This code example is part of a larger example provided for the SqlServices type.

Console.WriteLine("  Server: {0}",
    sqlExecutionException.Server);
Console.WriteLine("  Server: {0}", _
    sqlExecutionException.Server)

適用於