dotConnect for SQLite Documentation
Devart.Common Namespace / DbDump Class / EndRestore Method
The System.IAsyncResult returned by BeginRestore.
Example

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

    Parameters

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