I am trying to create a backup. I dont understand what the error I’m getting points to. Which is not found?!
this is the error message: http://img717.imageshack.us/img717/1772/sql1.jpg
my code:
public void BackupDatabase(String destinationPath)
{
try
{
//MY SERVER
String userName = "NNIT-Admin";
String password = "password";
String serverName = @"RITZEL-PC\SQLEXPRESS";
ServerConnection connection = new ServerConnection(serverName, userName, password);
Server sqlServer = new Server(connection);
Backup BackupMgr = new Backup();
BackupMgr.Devices.AddDevice(destinationPath, DeviceType.File);
BackupMgr.Database = @"RITZEL-PC\SQLEXPRESS\Databases\D:\MY_THESIS\WORKING FILES\NNIT-RMS.MDF";
BackupMgr.Action = BackupActionType.Database;
BackupMgr.SqlBackup(sqlServer);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message + " " + ex.InnerException);
}
}
private void BackUp_Btn_Click(object sender, EventArgs e)
{
String destinationPath = @"D:\";
BackupDatabase(destinationPath);
}
According to a quick Google search you need to install the 64-bit SMO components: