Adapter.Update()

G

Guest

I'm tring to update my Table which haven't a primary key from a DataGrid but
I'm having the following error"Dynamic SQL generation for the UpdateCommand
is not supported against a SelectCommand that does not return any key column
information."
this the code that I'm using:

Dim cmd As New OleDbCommand("select * from Choices where ID =2", cn)
Dim adapter As New OleDbDataAdapter(cmd)
Dim cmb As New OleDbCommandBuilder(adapter)
adapter.Fill(ds)
grdQuestions.DataSource = ds.Tables(0)
adapter.Update(ds)

where could be the problem!!?
Thnks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top