karthik1 0 Newbie Poster

hello,

i have 2 textboxes and an update button on my form. iam able to connect as well as navigate through the Access db but i am unable to update it. i am getting the following error:

Dynamic SQL generation for the UpdateCommand isnot supported against a SelectCommand that does not return any key column information.
InvalidoperationException

the code written is,

Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click


        Dim commandBuilder = New OleDbCommandBuilder(da)



        ds.Tables("Details").Rows(inc).Item(1) = IDTxt.Text
        ds.Tables("Details").Rows(inc).Item(2) = NameTxt.Text

        da.Update(ds, "Details")

        MsgBox("Data updated")

Why an exception/error occurs here. any better waz to update MSAccess

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.