Using transactions with TableAdapters
The commands are private members of the VisualStudio-generated adapter classes so I cannot access them to set their Transaction members.
Is there a "proper" way to do this?
The commands are private members of the VisualStudio-generated adapter classes so I cannot access them to set their Transaction members.
Is there a "proper" way to do this?
Look at Form1.vb in this sample. You will find the following code.
' start a transaction based on the ParentTableAdapter
transaction = Me.ParentTableAdapter.Connection.BeginTransaction()
' using the new transaction, establish all Adapters, including the ParentTableAdapter in the transaction
Me.ParentTableAdapter.AdapterTransaction = transaction
Me.ChildTableAdapter.AdapterTransaction = transaction
Me.GrandChildTableAdapter.AdapterTransaction = transaction