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连接。