asp.net transactions

G

Guest

Hi,

I am very new to asp.net transactions and had a quick query would the
following code work? so if either there was a problem with the Table Adapter
inserting the record or the Membership API failing to create the user the
whole process would roll back? Thanks Ash

ClientTableAdapter adapter = new ClientTableAdapter();

using (TransactionScope ts = new TransactionScope())
{
adapter.Insert(CompanyName.Text,
Premises.Text,
AddressLine1.Text,
AddressLine2.Text,
City.Text,
County.Text,
Postcode.Text,
Country.Text,
PhoneNo.Text,
FaxNo.Text,
EmailAddress.Text);

Membership.CreateUser(Username.Text, Password.Text);

}
 
Top