Thank you for your answer,
here is the code i used to backup my SQLite database :

var source = new SQLiteConnection("Data Source = MyDB.db ; Version = 3;");
var destination = new SQLiteConnection("Data Source = NewDBBackup.db;
Version = 3;");

source.Open();
destination.Open();

source.BackupDatabase(destination , "main", "main" , -1 , null , 0 );
source.Close();

2016-05-16 22:05 GMT+00:00 Kees Nuyt <k.nuyt at zonnet.nl>:

> On Mon, 16 May 2016 19:14:01 +0000, Objective C
> <developpeurcsharp at gmail.com> wrote:
>
> > Hi sir,
> > In fact, i have an issue with SQLite database Restore using c#
>
> That's not what this discussion thread is about, it would have
> been better if you sterted a new thread, but anyway.
>
> > i'm coding a button which can restore an existing
> > SQLite database with '*.db*' extension.
>
> > i wonder if you can guide me please,
>
> Can you describe what you already tried, what happened, and what
> made you think you didn't succeed?
>
> There are (at least) two methods:
> 1- use the SQLite backup API
>   See: www.sqlite.org/c3ref/backup_finish.html
>
> 2- copy the backup database over the database
>   using file system operations
>
> In the latter case you'll have to make sure
> - the backup database is consistent and does not
>   have a 'hot' journal
> - the database you are going to overwrite is not
>   used by any databse connection
> - the journal of the database you are overwriting
>   (if any) is removed.
>
> > i'll ber very grateful
> > Sincerely yours
> > Hashim
>
> --
> Regards,
>
> Kees Nuyt
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to