locked
Updating 2 tables from DataGridView RRS feed

  • Question

  • Hi,

    I am using the code here to update rows in a single DB table from a DataGridView.  I now need to be able to update rows in 2 tables.  I have googled this and tried various methods, but non of them seem to work. Any help would be appreciated.

    Thanks

     Try
                cmdBuilder = New SqlCommandBuilder(adapter)
                cmdBuilder.ConflictOption = ConflictOption.OverwriteChanges
                changes = ds.GetChanges()
                If changes IsNot Nothing Then
                    adapter.Update(changes)
                    adapter.AcceptChangesDuringUpdate = True
                    adapter.AcceptChangesDuringFill = True
                End If
                MsgBox("Location Notes Updated")
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
            changes.EndInit()
            connection.Close()

    Thursday, June 21, 2012 12:39 PM

Answers

All replies