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