using (var connection = new SqlConnection(connectionString)) { connection.Open(); using (var transaction = connection.BeginTransaction()) { try { // perform multiple SQL queries within the transaction SQLHandler.ExecuteQuery("INSERT INTO table1 (column1) VALUES ('value1')", connection, transaction); SQLHandler.ExecuteQuery("UPDATE table2 SET column2 = 'updated_value' WHERE id = 3", connection, transaction); // commit the transaction transaction.Commit(); Console.WriteLine("Transaction successful!"); } catch (Exception ex) { // rollback the transaction if any error occurred transaction.Rollback(); Console.WriteLine("Error occurred: " + ex.Message); } } }This example shows how to execute two separate SQL queries within a transaction using the SQLHandler package. If either query fails, the entire transaction is rolled back, ensuring data integrity. The package used in this example is likely the SQLHandler package.