PipelineComponent.ReleaseConnections 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
释放在 期间 AcquireConnections(Object)建立的连接。 设计时和运行时都被调用。
public:
virtual void ReleaseConnections();
public virtual void ReleaseConnections();
abstract member ReleaseConnections : unit -> unit
override this.ReleaseConnections : unit -> unit
Public Overridable Sub ReleaseConnections ()
示例
private System.Data.OleDb.OleDbConnection oledbConnection;
public override void ReleaseConnections()
{
if (oledbConnection != null && oledbConnection.State != ConnectionState.Closed )
oledbConnection.Close();
}
Private oledbConnection As System.Data.OleDb.OleDbConnection
Public Overrides Sub ReleaseConnections()
If Not (oledbConnection Is Nothing) AndAlso Not (oledbConnection.State = ConnectionState.Closed) Then
oledbConnection.Close
End If
End Sub
注解
在组件设计过程中以及组件执行结束时反复调用。 组件应释放 AcquireConnections在 中已打开并维护的所有连接。