Enlists in the specified transaction.
These samples demonstrate usage of
EnlistTransaction.
SQLiteCommand1.Connection=SQLiteConnection1;
using (TransactionScope transScope = new TransactionScope()) {
SQLiteConnection1.Open();
SQLiteCommand1.ExecuteNonQuery();
transScope.Complete();
}
SQLiteConnection1.Close();
- or -
SQLiteCommand1.Connection=SQLiteConnection1;
SQLiteConnection1.Open();
using (TransactionScope transScope = new TransactionScope()) {
SQLiteConnection1.EnlistTransaction(Transaction.Current);
SQLiteCommand1.ExecuteNonQuery();
transScope.Complete();
}
SQLiteConnection1.Close();
- or -
CommittableTransaction cmtTx = new CommittableTransaction();
SQLiteConnection1.Open();
SQLiteConnection1.EnlistTransaction(cmtTx);
SQLiteCommand1.ExecuteNonQuery();
SQLiteConnection1.Close();
Me.SQLiteCommand1.Connection = Me.SQLiteConnection1
Using transScope = New Transactions.TransactionScope
Me.SQLiteConnection1.Open()
Me.SQLiteCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.SQLiteConnection1.Close()
- or -
Me.SQLiteCommand1.Connection = Me.SQLiteConnection1
Me.SQLiteConnection1.Open()
Using transScope = New Transactions.TransactionScope
Me.SQLiteConnection1.EnlistTransaction(Transactions.Transaction.Current)
Me.SQLiteCommand1.ExecuteNonQuery()
transScope.Complete()
End Using
Me.SQLiteConnection1.Close()
- or -
Dim cmtTx As New Transactions.CommittableTransaction
Me.SQLiteConnection1.Open()
Me.SQLiteConnection1.EnlistTransaction(cmtTx)
Me.SQLiteCommand1.ExecuteNonQuery()
Me.SQLiteConnection1.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