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

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

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 1 and 4 and type the answer here:

User Comments

Title: Very Gud   
Name: Soby
Date: 6/9/2007 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-2009 ASPAlliance.com  |  Page Processed at 11/8/2009 8:22:30 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search