Wednesday, 21 August 2013

Implementing a save button in VB.net to save data to TWO tables

Implementing a save button in VB.net to save data to TWO tables

I've created a form using fields in two tables and need to save data to
both of them. The auto generated binding navigator code only works for one
table. I know that is obvious and I have tried to insert some other code
to it but it didn't work.
Private Sub CustomerBindingNavigatorSaveItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
CustomerBindingNavigatorSaveItem.Click
Me.Validate()
Me.CustomerBindingSource.EndEdit()
Me.BillBindingSource.EndEdit() '(Code I added)
Me.TableAdapterManager.UpdateAll(Me.PawningCenterDBDataSet)
End Sub
Also I tried to create a separate save button, but the same thing
happened. How can I implement a save button to save data to both tables?

No comments:

Post a Comment