SqlExecutionException.Database 屬性

定義

取得例外狀況發生時所存取的資料庫名稱。Gets the name of the database being accessed when the exception occurred.

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

屬性值

例外狀況發生時所存取的資料庫名稱。The name of the database being accessed when the exception occurred.

範例

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

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

適用於