当我执行我的程序时,当有一个现有项目时,执行必须进入 catch
con2=new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0DataSource=e:\\convert.accdb" + "; Persist Security Info=False");
OleDbCommand cmd = new OleDbCommand(sql, con2);
con2.Open();
try {
cmd.ExecuteNonQuery();
con2.Close();
MessageBox.Show("Thanks");
}
catch (Exception ex) {
MessageBox.Show(ex.Message);
con.Close();
}