HighTechTalks DotNet Forums  

Transaction in dataset: TableAdapterManager

Dotnet General Discussions microsoft.public.dotnet.general


Discuss Transaction in dataset: TableAdapterManager in the Dotnet General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jay Pabs
 
Posts: n/a

Default Transaction in dataset: TableAdapterManager - 07-06-2010 , 07:30 PM






After a long hour of research on how to make dataset transactional I
am not still satisfied with the results. Currently I have setup a
transaction for every command in my dataset like:

Partial Public Class OrdersTableAdapter
Public Sub AssignConnection(ByVal conn As
SqlClient.SqlConnection, Optional ByVal trans As
SqlClient.SqlTransaction = Nothing)
Me.Connection = conn

If trans IsNot Nothing Then
Me.Adapter.InsertCommand.Transaction = trans
Me.Adapter.DeleteCommand.Transaction = trans
Me.Adapter.UpdateCommand.Transaction = trans
End If

Me.Adapter.AcceptChangesDuringUpdate = False

Me.Adapter.ContinueUpdateOnError = False
End Sub
End Class

This is working but if I have so many Table (like one to many
relationship) in my dataset I have to create every transaction and
update it one by one like:

Me.OrdersTableAdapter.Update(Me.OrdersDataSet.Orde rs)
Me.OrderDetailsTableAdapter.Update(Me.CustomersDat aSet.OrderDetails)

What I want is the same functionality as VB.NET 2008 to update all
table at once using TableAdapterManager like:

Me.TableAdapterManager.UpdateAll(Me.OrdersDataSet)

Anyone know how to do this?

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.