共用方式為


DbConnection.StateChange 事件

定義

當連線的狀態變更時發生。

public:
 virtual event System::Data::StateChangeEventHandler ^ StateChange;
public virtual event System.Data.StateChangeEventHandler StateChange;
public virtual event System.Data.StateChangeEventHandler? StateChange;
member this.StateChange : System.Data.StateChangeEventHandler 
Public Overridable Custom Event StateChange As StateChangeEventHandler 

事件類型

備註

當連接的狀態從關閉變更為已開啟或從已開啟變更為已關閉時,就會發生此 StateChange 事件。

適用於

另請參閱