How to Write Atomic Transactions in .NET
page 5 of 7
by Keyvan Nayyeri
Feedback
Average Rating: 
Views (Total / Last 10 Days): 37433/ 63

Test Application

To test my Atomic transaction, I wrote a Windows Form application that used my Class Library.  It simply got the ID and value for an account and passed them to Transfer() method.  This Windows Form application must have a reference to System.EnterpriseServices as well.

Figure 4

This is the event handler for my btnTransfer button:

Listing 6

private void btnTransfer_Click(object sender, EventArgs e)
{
    MyTransaction transaction = new MyTransaction(); 
 
    try
    {
        transaction.Transfer(
            Convert.ToInt32(txtID.Text),
            Convert.ToInt32(txtValue.Text),
            "Data Source=localhost;Initial "
            + "Catalog=AtomicTransaction;" 
            + "Integrated Security=True;Pooling=False");
    }
    catch (Exception ex)
    {
        throw ex;
    } 
 
    MessageBox.Show("Finished!");
}

View Entire Article

User Comments

Title: ASAS   
Name: ASAS
Date: 2012-08-01 7:53:47 AM
Comment:
asd
Title: Very Gud   
Name: Soby
Date: 2007-06-09 7:26:03 AM
Comment:
This is very Help for me

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-19 6:25:29 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search