Commit()

var myDB = new Database("DSN=catalogue;")
myDB.AutoCommit(false)
if (myDB.ExecuteSQL("INSERT INTO Product (ProdName, Price) VALUES ("Product1", 100);"))
{
 if (myDB.ExecuteSQL("INSERT INTO Product (ProdName, Price) VALUES ("Product2", 200);"))
 {
  myDB.Commit() // Keep the changes
 } else {
  myDB.Rollback() // undo the first insert if the second insert goes wrong
 }
}

Close