共用方式為


ExpectedSqlExceptionAttribute.MatchFirstError 屬性

取得值,該值代表預期的嚴重性、狀態和錯誤代碼是否應該與 SqlException 中的第一個 SqlError 比對。

命名空間:  Microsoft.Data.Schema.UnitTesting
組件:  Microsoft.Data.Schema.UnitTesting (在 Microsoft.Data.Schema.UnitTesting.dll 中)

語法

'宣告
Public Property MatchFirstError As Boolean
    Get
    Set
public bool MatchFirstError { get; set; }
public:
property bool MatchFirstError {
    bool get ();
    void set (bool value);
}
member MatchFirstError : bool with get, set
function get MatchFirstError () : boolean
function set MatchFirstError (value : boolean)

屬性值

型別:System.Boolean
若要將預期嚴重性、狀態和錯誤代碼和例外狀況中的第一個 SqlError 比對,則為 true。如果要將預期嚴重性、狀態和錯誤代碼與例外狀況中的任何 SqlError 比對,則為 false。

.NET Framework 安全性

請參閱

參考

ExpectedSqlExceptionAttribute 類別

Microsoft.Data.Schema.UnitTesting 命名空間

SqlException

SqlError