public int ExcuteCommand(string sql)
{
int result = -1;
OleDbConnection myconn = getcon();
OleDbTransaction trans = myconn.BeginTransaction(IsolationLevel.ReadCommitted);
try
{
OleDbCommand cmd = new OleDbCommand(sql, myconn);
cmd.Transaction = trans;
trans.Commit();
result = cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
trans.Rollback();
throw (ex);
}
finally
{
myconn.Dispose();
myconn.Close();
}
return result;
}