dotConnect for PostgreSQL Documentation
Devart.Common Namespace / DbDump Class / EndBackup Method
The System.IAsyncResult returned by BeginBackup.
Example

In This Topic
    EndBackup Method
    In This Topic
    Ends an asynchronous invocation of the Backup method.
    Syntax
    'Declaration
     
    Public Sub EndBackup( _
       ByVal result As IAsyncResult _
    ) 
    public void EndBackup( 
       IAsyncResult result
    )

    Parameters

    result
    The System.IAsyncResult returned by BeginBackup.
    Remarks
    The function ends an asynchronous backup that is started with BeginBackup. A pair of asynchronous functions (BeginBackup and EndBackup) can be used instead of the synchronous function Backup to gain more performance and flexibility in your application.
    Example
    This sample demonstrates performing async backup and restore operations.
    public void DumpIt(PgSqlConnection conn)
    {
            conn.Open();
            PgSqlDump pgSqlDump = new PgSqlDump();
            pgSqlDump.Connection = conn;
            pgSqlDump.Schema = "public";
            pgSqlDump.Tables = "dept;emp";
            pgSqlDump.IncludeDrop = true;
            IAsyncResult Result = pgSqlDump.BeginBackup("d:\\dump.dmp");
            while (!Result.IsCompleted)
            {
                    Console.Write(".");
                    //Perform here any operation you need
            }
            pgSqlDump.EndBackup(Result);
            Console.WriteLine("Dumped.");
            conn.Close();
    }
    
    public void UnDumpIt(PgSqlConnection conn)
    {
            conn.Open();
            PgSqlDump pgSqlDump = new PgSqlDump();
            pgSqlDump.Connection = conn;
            IAsyncResult Result = pgSqlDump.BeginRestore("d:\\dump.dmp");
            while (!Result.IsCompleted)
            {
                    Console.Write(".");
                    //Perform here any operation you need
            }
            pgSqlDump.EndRestore(Result);
            Console.WriteLine("Restored.");
            conn.Close();
    }
    Public Sub DumpIt(conn As PgSqlConnection)
            conn.Open()
            Dim pgSqlDump As New PgSqlDump()
            pgSqlDump.Connection = conn
            pgSqlDump.Schema = "public"
            pgSqlDump.Tables = "dept;emp"
            pgSqlDump.IncludeDrop = True
            Dim Result As IAsyncResult = pgSqlDump.BeginBackup("d:\dump.dmp")
            While Not Result.IsCompleted
                    'Perform here any operation you need
                    Console.Write(".")
            End While
            pgSqlDump.EndBackup(Result)
            Console.WriteLine("Dumped.")
            conn.Close()
    End Sub
    
    Public Sub UnDumpIt(conn As PgSqlConnection)
            conn.Open()
            Dim pgSqlDump As New PgSqlDump()
            pgSqlDump.Connection = conn
            Dim Result As IAsyncResult = pgSqlDump.BeginRestore("d:\dump.dmp")
            While Not Result.IsCompleted
                    'Perform here any operation you need
                    Console.Write(".")
            End While
            pgSqlDump.EndRestore(Result)
            Console.WriteLine("Restored.")
            conn.Close()
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also