Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want update/edit data in database (MS Access) by using DataGridView in VB.net I used this code:

       Dim sadapter As OleDb.OleDbDataAdapter
       Dim sds As DataSet
       sadapter.Update(sds, "marks") 

then showing this message:

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

like image 272
user1930629 Avatar asked Dec 26 '12 20:12

user1930629


2 Answers

If your table doesn't have a primary key you can use SqlDataAdapter.Fill

like image 89
jerhewet Avatar answered Nov 03 '22 10:11

jerhewet


If you table doesn't have a primary key, you need to set one.

like image 25
Nashath Nasik Avatar answered Nov 03 '22 11:11

Nashath Nasik