Skip to content

SQL Transaction Support

MixERP edited this page Feb 5, 2016 · 1 revision

This wiki page refers to NPoco transaction support.

Example 1

using (IDatabase db = new Database("connStringName")) 
{
    db.BeginTransaction();
    //Your CRUD operation here
    db.CompleteTransaction();
}

Example 2

using (IDatabase db = new Database("connStringName")) 
{
    using (var transaction = db.GetTransaction())
    {
        //Your CRUD operation here
        transaction.Complete();
    }
}