This documentation is archived and is not being maintained.

Transaction.TransactionCompleted Event

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

Indicates that the transaction is completed.

Namespace: System.Transactions
Assembly: System.Transactions (in system.transactions.dll)

public:
event TransactionCompletedEventHandler^ TransactionCompleted {
	void add (TransactionCompletedEventHandler^ value);
	void remove (TransactionCompletedEventHandler^ value);
}
/** @event */
public void add_TransactionCompleted (TransactionCompletedEventHandler value)

/** @event */
public void remove_TransactionCompleted (TransactionCompletedEventHandler value)

JScript supports the use of events, but not the declaration of new ones.

Exception typeCondition

ObjectDisposedException

An attempt to subscribe this event on a transaction that has been disposed.

You can register for this event instead of using a volatile enlistment to get outcome information for transactions. The parameter passed to the TransactionCompletedEventHandler delegate is a Transaction instance. You can then query the TransactionInformation property of the specific instance to get an instance of TransactionInformation, whose Status property contains the status of a transaction with either the Committed or Aborted value.

Caution   Signing up for this event negatively affects the performance of the transaction it is attached to.

The following sample shows how an application can obtain the outcome of a transaction by subscribing to the TransactionCompleted event.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, 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
Show: