(1) View the Tutorial
http://www.youtube.com/watch?v=K2C_ia0KGCc&feature=youtu.be
(2) Try out the code
use my above mentioned free control and njoy Database operations with less code
dcon.ExecNonQuery("delete from folderPath");
dcon.ExecNonQuery("BACKUP DATABASE Timber_Demo TO DISK = N'" + txtFName.Text + "'");
MessageBox.Show("Backup Done Successfully");
//Restore Operation
txtFName.Text = openFileDialog1.FileName;
dcc = new DBConClass();
dcc.setSQLConnection(@".", "master", "sa", "sql");
string alt = "ALTER DATABASE Timber_Demo SET OFFLINE WITH ROLLBACK IMMEDIATE";
dcc.ExecNonQuery(alt);
dcc = new DBConClass();
dcc.setSQLConnection(@".", "master", "sa", "sql");
string restore = "restore database Timber_Demo from DISK =N'" + txtFName.Text + "'WITH FILE=1,NOUNLOAD,REPLACE,Stats=10";
int res = dcc.ExecNonQuery(restore);
dcc = new DBConClass();
dcc.setSQLConnection(@".", "master", "sa", "sql");
alt = "ALTER DATABASE Timber_Demo SET ONLINE";
dcc.ExecNonQuery(alt);
MessageBox.Show("Data Restored successfully");
txtFName.Text = "";
dcc.setSQLConnection(@".", "Timber_Demo", "sa", "sql");