AspNet.sk     Diskusné fóra     Vitajte v QuickStarts     ASP.NET     Silverlight     Ako môžem...? (en)     Class prehliadač Príklady chcem v ...   
Menu
Skip Navigation Links.

How Do I...? Common Tasks QuickStart Tutorial

How Do I...Get the outcome of a transaction?

Transaction outcome is handled through events. To receive the outcome of a specific transaction you need to handle the TransactionCompletedEvent event which is on the Transaction object.

Here is an example of how to receive the TransactionCompletedEvent event:

1. Register for the TransactionCompletedEvent for the transaction you want to receive the outcome for


	AddHandler MyTx.TransactionCompleted, AddressOf Current_TransactionCompleted
VB

2. Within the handler you can access the outcome of the transaction by looking at the Status property on the TransactionInformation class. This can be accessed from the TransactionEventArgs e, which is a Transaction object.


        Public Shared Sub Current_TransactionCompleted(ByVal sender As Object, ByVal e As TransactionEventArgs)
            Console.WriteLine("Status:         {0}", e.Transaction.TransactionInformation.Status)
            Console.WriteLine("ID:             {0}", e.Transaction.TransactionInformation.LocalIdentifier)
        End Sub
VB

Here is a full example:

[This sample can be found at H:\Home\WU_000036_efe47225c86ca62f325a01d8519bc002\Webs\aspnet.sk\quickstarts\QuickStartv20\howto\samples\Transactions\TxOutcome
To build this sample, open the SDK command prompt and navigate to the above path. Build the sample using the build tool msbuild passing the solution file as the first parameter: msbuild mySample.sln. The compiled executable will be found in the sub directory \bin directory.]




Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright � 2005 Microsoft Corporation. All rights reserved.


Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright © 2005 Microsoft Corporation. All rights reserved.
Preklad do slovenského jazyka - Copyright © 2005 - 2007 www.aspnet.sk, www.qsh.sk
Pošlite komentár k tejto stránke
Copyright © 2002 - 2008 Chastia, spol. s r. o., Igor Stanek, Designed by Lacino
Portál je hostovaný na serveroch firmy Quantasoft - www.qsh.sk.