private void DBForm_Load(object sender, EventArgs e) { backupProgress = new SQLDMO.BackupSink_PercentCompleteEventHandler(Backup_PercentComplete); restoreProgress = new SQLDMO.RestoreSink_PercentCompleteEventHandler(Restore_PercentComplete); DataTable dt = BackupRestore.LoadBackupHistory(); dataGridView1.DataSource = dt; }
private void ProcessRestore(int id, string path) { bool db = true; db = BackupRestore.SQLDbRestore(id, restoreProgress, out oRestore); toolStripProgressBar1.Visible = false; statusStrip1.Refresh(); Application.DoEvents(); if (db) { MessageBox.Show("恢复完毕!"); toolStripStatusLabel1.Text = "恢复完成"; } else { MessageBox.Show("数据库恢复失败!"); toolStripStatusLabel1.Text = "数据库恢复失败"; } button2.Enabled = true; }
private void ProcessBackup(string path) { bool db = true; db = BackupRestore.SQLDbBackup(path, backupProgress, out oBackup, textBox1.Text.Trim()); toolStripProgressBar1.Visible = false; statusStrip1.Refresh(); Application.DoEvents(); if (db) { MessageBox.Show("备份完毕!"); toolStripStatusLabel1.Text = "备份完成"; } else { MessageBox.Show("备份数据库失败!"); toolStripStatusLabel1.Text = "数据库备份失败"; } DataTable dt = BackupRestore.LoadBackupHistory(); dataGridView1.DataSource = dt; button1.Enabled = true; }
private void DBForm_Load(object sender, EventArgs e) { DataTable dt = BackupRestore.LoadBackupHistory(); dataGridView1.DataSource = dt; }