示例#1
0
 private void btnBackup_Click(object sender, EventArgs e)
 {
     try
     {
         BusinessManager BM = new BusinessManager();
         BOBackup        BO = new BOBackup();
         BO.BackupLocation = txtLocation.Text;
         int rowsAffected = BM.BALBackupDatabase(BO);
         MessageBox.Show("Database successfully backed up", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtLocation.Clear();
         btnBackup.Enabled = false;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }