I have this code for inserting data into a database. Before I commit, I want to be sure that the data is entered successfully, then commit else rollback both inserts.
try {
statement one commit;
statement two commit;
}
catch {
error message
statement 1 Rollback();
statement 2 Rollback();
}
finally {
if (con.State == Con.Open)
con.Close();
}