OleDbCommand cmd = new OleDbCommand("", conn);
conn.Open();
OleDbTransaction tran = conn.BeginTransaction();
cmd.Transaction = tran;
try
{
foreach (string sql in values)
{
cmd.CommandText = sql;
cmd.ExecuteNonQuery();
}
tran.Commit();
return true;
}
catch (Exception)
{
tran.Rollback();
return false;
//MessageBox.Show(e.ToString(), "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Error);