0

I have a datagridview which retrieve data from my ms access file

also I hid the primary key.

If I added another row and used da.Update(dt)
it gives an error because the primary key is empty.
now I have a separate textbox for that primary key how can I update the table and the primary key will get the value of textbox?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by lolafuertes
0

2 options:
a) do not hid the primary key, hid their visibility in the datagridview
b) use an OleDbCommand to upate the database, then refill the datatable and refresh the datagridview.

Hope this helps

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.