Beispiel #1
0
 private void btnSure_Click(object sender, EventArgs e)
 {
     try
     {
         if (MDFPath == "")
         {
             MessageBox.Show("附加数据库不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             DbOperator operate = new DbOperator();
             operate.DatabaseName = "CMS";
             operate.MDFPath      = MDFPath;
             operate.LDFPath      = LDFPath;
             operate.AttachDatabase();
         }
     }
     catch (Exception se)
     {
         MessageBox.Show(se.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     DevExpress.XtraEditors.XtraMessageBox.Show("系统数据库附加成功,请重启本系统", "恭喜!");
     this.DialogResult = DialogResult.OK;
 }