用SQLDMO做SQL数据库备份如何显示进度条
我用SQLDMO做SQL数据库备份,现在已经备份成功了,但是进度条不能实时显示备份进度,下面是我设计的进度条代码,不知有何问题,请指点一下 private void button2_Click(object sender, EventArgs e)
{
//前面代码省略
SQLDMO.BackupSink_PercentCompleteEventHandler pceh = new SQLDMO.BackupSink_PercentCompleteEventHandler(Step);
sqldmo_backup.PercentComplete += pceh;
//后面代码省略
}
private void Step(string message, int percent)
{
progressBar1.Value = percent;
}