1.1

Table Of Contents
cmd.CommandText = "update t1 set addr = ? where id = ?";
tran = conn.BeginTransaction(IsolationLevel.ReadCommitted);
cmd.Transaction = tran;
bool success = true;
for (int i = 100; i < 200; i++) {
cmd.Parameters.Clear();
cmd.Parameters.Add("address" + i);
cmd.Parameters.Add(i);
if (cmd.ExecuteNonQuery() != 1) {
// update failed; rolling back the entire transaction
success = false;
tran.Rollback();
break;
}
}
if (success) {
// all succeeded; commit the transaction
tran.Commit();
}
// drop the table
cmd = new SQLFCommand("drop table t1", conn);
cmd.ExecuteNonQuery();
conn.Close();
}
685
ADO.NET Driver Reference