我正试图拿出支持。 我急切理解一下我所说的错误。 什么找不到?
http://img717.imageshack.us/img717/1772/sql1.jpg”rel=“nofollow” 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-PCSQLEXPRESS";
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-PCSQLEXPRESSDatabasesD:MY_THESISWORKING FILESNNIT-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);
}