OleDbConnection oleDbConnection1 = new OleDbConnection();
OleDbCommand command = null;
oleDbConnection1.ConnectionString = "Provider=MSDAORA.1;Data Source=clientag;Persist Security Info=True;Password=XXX;User ID=XXX";
command = new OleDbCommand();
command.Connection = oleDbConnection1;
oleDbConnection1.Open();
OleDbTransaction trans = oleDbConnection1.BeginTransaction();
try
{
command.Transaction = trans;
command.CommandText = "insert into TABLENAME (ID) values('1')";
command.ExecuteNonQuery();
command.CommandText = "update TABLENAME1 set VALUE = 3 where ID = '1'";
command.ExecuteNonQuery();
trans.Commit();
}
catch (Exception ex)
{
trans.Rollback();
MessageBox.Show(ex.ToString());
}
finally
{
oleDbConnection1.Close();
}