How to update MS Access DB from a VB.Net Gridview Control
Asked By
0 points
N/A
Posted on - 10/01/2011
I have a table designed in MS Access with the below fields:
DC No (Primary Key and Not Auto Generated – Integer
Item Description – Text
Reference Number – Text and
Quantity – Integer
My VB.NET form has a textbox field where the user would enter the DC Number. I have used the Grid Control to displays the fields (field number 2 to 4). My problem is, I do not know what piece of code should I have for my SAVE button's click event to write the data both from my Textbox and Grid rows to the MS Access database. I tried the basic Binding to Database as seen in the MSDN pages but it does not help. It keeps throwing me an error:
"Too few columns for the primary key"I could hardly understand what does this error mean and how is it related to my case. Any guidance, please?