PipelineComponent.ReleaseConnections 方法

定义

释放在 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连接。

适用于