Table of Contents

Method RollbackTransaction

Namespace
YndigoBlue.Velocity.Engine
Assembly
YndigoBlue.Velocity.dll

RollbackTransaction()

Rolls back the current database transaction, undoing all changes made since BeginTransaction.

public void RollbackTransaction()

Examples

using (var m = new Manager(conn))
{
    m.BeginTransaction();

    try
    {
        // Perform operations that might fail...
    }
    catch (Exception ex)
    {
        m.RollbackTransaction();
        Console.WriteLine("Transaction rolled back due to error");
        throw;
    }
}

Exceptions

DbException

Thrown when a database error occurs.