SqlExecutionException.Exception 屬性

定義

取得處理 SQL 命令時發生的例外狀況。Gets the exception encountered when processing the SQL commands.

public:
 property System::Data::SqlClient::SqlException ^ Exception { System::Data::SqlClient::SqlException ^ get(); };
public System.Data.SqlClient.SqlException Exception { get; }
member this.Exception : System.Data.SqlClient.SqlException
Public ReadOnly Property Exception As SqlException

屬性值

處理 SQL 命令時發生的 SqlExceptionThe SqlException encountered when processing the SQL commands.

範例

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

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

適用於

另請參閱