You are here: Craig > CodeSmith/NetTiers

Insert/Update/Delete in a Transaction

Dim Tran As TransactionManager

 

Tran = DataRepository.Provider.CreateTransaction()

 

Try

Tran.BeginTransaction()

DataRepository.Table1Provider.Insert(Tran, T1)

DataRepository.Table2Provider.Update(Tran, T2)

DataRepository.Table3Provider.Delete(Tran, T3)

Tran.Commit()

Catch ex As Exception

Tran.Rollback()

End Try