Поделиться через


Метод LogProviderBase.CloseLog

Called at the end of package execution.

Пространство имен:  Microsoft.SqlServer.Dts.Runtime
Сборка:  Microsoft.SqlServer.ManagedDTS (в Microsoft.SqlServer.ManagedDTS.dll)

Синтаксис

'Декларация
Public Overridable Sub CloseLog
'Применение
Dim instance As LogProviderBase

instance.CloseLog()
public virtual void CloseLog()
public:
virtual void CloseLog()
abstract CloseLog : unit -> unit  
override CloseLog : unit -> unit
public function CloseLog()

Замечания

CloseLog is called at the end of package execution after all of the objects in the package have completed execution, or when the package terminates due to errors. When writing a custom log provider, use this method to close active connections and perform cleanup work.

Примеры

The following code example demonstrates an implementation of CloseLog, which closes the file stream opened during the OpenLog method.

public override void CloseLog()
{
    if (sw != null)
    {
        sw.WriteLine("Close log" + System.DateTime.Now.ToShortTimeString());
        sw.Close();
    }
}
Public Overrides  Sub CloseLog()
    If Not sw Is Nothing Then
        sw.WriteLine("Close log" + System.DateTime.Now.ToShortTimeString())
        sw.Close()
    End If
End Sub

For more information about the variables used in this example, see the OpenLog method.

См. также

Справочник

LogProviderBase Класс

Пространство имен Microsoft.SqlServer.Dts.Runtime