Enlists in the specified transaction.
These samples demonstrate usage of
Devart.Data.QuickBooks.QuickBooksConnection.EnlistTransaction.
quickBooksCommand1.Connection=quickBooksConnection1;
using (TransactionScope transScope = new TransactionScope()) {
quickBooksConnection1.Open();
quickBooksCommand1.ExecuteNonQuery();
transScope.Complete();
}
quickBooksConnection1.Close();
- or -
quickBooksCommand1.Connection=quickBooksConnection1;
quickBooksConnection1.Open();
using (TransactionScope transScope = new TransactionScope()) {
quickBooksConnection1.EnlistTransaction(Transaction.Current);
quickBooksCommand1.ExecuteNonQuery();
transScope.Complete();
}
quickBooksConnection1.Close();
- or -
CommittableTransaction cmtTx = new CommittableTransaction();
quickBooksConnection1.Open();
quickBooksConnection1.EnlistTransaction(cmtTx);
quickBooksCommand1.ExecuteNonQuery();
quickBooksConnection1.Close();
Me.quickBooksCommand1.Connection = Me.quickBooksConnection1
Using transScope = New Transactions.TransactionScope
Me.quickBooksConnection1.Open()
Me.quickBooksCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.quickBooksConnection1.Close()
- or -
Me.quickBooksCommand1.Connection = Me.quickBooksConnection1
Me.quickBooksConnection1.Open()
Using transScope = New Transactions.TransactionScope
Me.quickBooksConnection1.EnlistTransaction(Transactions.Transaction.Current)
Me.quickBooksCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.quickBooksConnection1.Close()
- or -
Dim cmtTx As New Transactions.CommittableTransaction
Me.quickBooksConnection1.Open()
Me.quickBooksConnection1.EnlistTransaction(cmtTx)
Me.quickBooksCommand1.ExecuteNonQuery()
Me.quickBooksConnection1.Close()
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2