hi friends
I am trying to search a table with last and first name and update table after changes .I can retrieve rows and display in datagridview,
I would like to know how do I update table after changes, i would appreciate any help

 Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        ds.Tables("table1").DefaultView.RowFilter = "FName_ LIKE '*" & TextBox1.Text & "*' OR  LName_ LIKE '*" & TextBox1.Text & "*'"
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Me.data IsNot Nothing Then
            Dim builder As New OleDbCommandBuilder(Me.adapter)
            Me.adapter.Update(Me.data)
        End If
    End Sub

Recommended Answers

All 2 Replies

Hi,
You need to apply an UPDATE statement. You can either define one for your adapter via the UpdateCommand property (OLEDB DataAdapter.UpdateCommand) Or run an Update statement via a OleDbCommand

thanks for the link , i solved it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.