DbException.SqlState 屬性

定義

針對支援的資料庫提供者,包含標準 SQL 5 字元傳回碼,指出資料庫作業成功或失敗。 前 2 個字元代表傳回碼的類別 (例如錯誤、成功),而最後 3 個字元代表子類別,允許以資料庫可移植的方式偵測錯誤案例。

針對不支援的資料庫提供者,或不適用的錯誤案例,包含 null

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

屬性值

標準 SQL 5 字元傳回碼或 null

適用於