I programmed a c# application with sqlite database.I saved the address of database in setting of project as string :
Data Source=bazarganidb.db;version=3
and i use it in my program as below:
SQLiteConnection con = new SQLiteConnection(Properties.Settings.Default.ConnectionString);
now how can i delete this database and replace with another database to restore backuped database?
What I have tried:
I backuped my database with this code:
private void button1_Click(object sender, EventArgs e)
{
using (var source = new SQLiteConnection("Data
Source=bazarganidb.db;version=3"))
using (var destination = new SQLiteConnection("Data Source=" + textBox1.Text + "/" + DateTime.Now.ToString("yyyyMMdd") + "backup.db"))
{
source.Open();
destination.Open();
source.BackupDatabase(destination, "main", "main", -1, null, 0);
}
}
but i dont know about restoring