Skip to content

Commit

Permalink
Fixing transaction doc samples (#1632)
Browse files Browse the repository at this point in the history
BeginTransaction - no parameters
BeginTransaction2 - named transaction/savepoint
BeginTransaction3 - named transaction/savepoint + isolation level
  • Loading branch information
David-Engel authored Jun 3, 2022
1 parent d0c5c26 commit 9b1996a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/samples/SqlConnection_BeginTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private static void ExecuteSqlTransaction(string connectionString)
SqlTransaction transaction;

// Start a local transaction.
transaction = connection.BeginTransaction("SampleTransaction");
transaction = connection.BeginTransaction();

// Must assign both transaction object and connection
// to Command object for a pending local transaction
Expand Down
2 changes: 1 addition & 1 deletion doc/samples/SqlConnection_BeginTransaction2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private static void ExecuteSqlTransaction(string connectionString)
// Attempt to roll back the transaction.
try
{
transaction.Rollback();
transaction.Rollback("SampleTransaction");
}
catch (Exception ex2)
{
Expand Down
2 changes: 1 addition & 1 deletion doc/samples/SqlConnection_BeginTransaction3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static void ExecuteSqlTransaction(string connectionString)
{
try
{
transaction.Rollback();
transaction.Rollback("SampleTransaction");
}
catch (SqlException ex)
{
Expand Down

0 comments on commit 9b1996a

Please sign in to comment.