Export (0) Print
Expand All

SqlConnection.EnlistTransaction Method

Note: This method is new in the .NET Framework version 2.0.

Enlists in the specified transaction as a distributed transaction.

Namespace: System.Data.SqlClient
Assembly: System.Data (in system.data.dll)

public override void EnlistTransaction (
	Transaction transaction
)
public void EnlistTransaction (
	Transaction transaction
)
public override function EnlistTransaction (
	transaction : Transaction
)

Parameters

transaction

A reference to an existing Transaction in which to enlist.

New in ADO.NET 2.0 is support for using the EnlistTransaction method to enlist in a distributed transaction. Because it enlists a connection in a Transaction instance, EnlistTransaction takes advantage of functionality available in the System.Transactions namespace for managing distributed transactions, making it preferable to EnlistDistributedTransaction, which uses a System.EnterpriseServices.ITransaction object. It also has slightly different semantics: once a connection is explicitly enlisted on a transaction, it cannot be unenlisted or enlisted in another transaction until the first transaction finishes. For more information about distributed transactions, see Performing a Distributed Transaction.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft