SqlExecutionException.SqlFile 屬性

定義

取得檔案的路徑和名稱,該檔案包含例外狀況發生時所執行的 SQL 命令。Gets the path and name of the file containing the SQL commands being run when the exception occurred.

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

屬性值

檔案的路徑和名稱,該檔案包含例外狀況發生時所執行的 SQL 命令。The path and name of the file that contains the SQL commands being run when the exception occurred.

範例

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

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

適用於