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