Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
VB
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
        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()


Hi,
I use the above code to update a db table from a datagridview. I now need to be able to update 2 db tables from the same DGV. This code no longer works. Could any one please advise on this as I am new to VB coding.
Many thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900