VistaDB 6
VistaDB.Provider Namespace / VistaDBConnection Class / BackupDatabase Method / BackupDatabase(Stream) Method
An opened and writable System.IO.Stream to write the backed up database to.


In This Topic
    BackupDatabase(Stream) Method
    In This Topic
    Backup the current database to a stream.
    Syntax
    'Declaration
     
    
    Public Overloads Sub BackupDatabase( _
       ByVal backupStream As System.IO.Stream _
    ) 
    'Usage
     
    
    Dim instance As VistaDBConnection
    Dim backupStream As System.IO.Stream
     
    instance.BackupDatabase(backupStream)
    public void BackupDatabase( 
       System.IO.Stream backupStream
    )

    Parameters

    backupStream
    An opened and writable System.IO.Stream to write the backed up database to.
    Exceptions
    ExceptionDescription
    If the backupStream is null
    If the backupStream is not writable
    If the database is not in a valid open mode for backup.
    Remarks

    A compressed backup of the currently open database will be made into the provided stream, preserving the encryption of the database (if any). The backup cannot be opened directly and must be restored using the RestoreDatabase(Stream,String,String) method to be operational.

    The connection to the database must have the VistaDB.VistaDBDatabaseOpenMode set to ExclusiveReadOnly, ExclusiveReadWrite, or SharedReadOnly to back up the database. This ensures no other process is modifying data while the back up is being performed.

    The stream must not add any extra content after the VistaDB backup data but may add a custom prefix of data before calling if this prefix will also be managed upon restoration.

    The caller must close and dispose the stream.

    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