vb.net tableadapter update command
Posted on 2011-03-02
I do not know how to write an update command, and could use some help.
I have a datagridview that is linked to an access database. The table is "tblLetters", and the fields are "Descr", "Sent", "Return", "Rec", "Notes"
In the DataGridView1_CellEndEdit routine I have the following code:
In the DataSet tblLettersTableAdapter I have the following Command Text in the Update Command:
SET Descr = ?, Sent = ?, Return = ?, Rec = ?, Notes = ?
Now I know this is wrong, and if you are interested in knowing what this does, well whatever record you make the update on, lets say letter #5, now becomes the record for every letter. Instead of having letters 1-10, you now have 10 letters that all have the same information as letter #5. As you can tell, I'm not a programmer, more of a hack just trying to write a small program for our admin people.
There is no primary key in the tblLetters, not sure if I need to have one or not.
Hopefully I haven't left anything out. Thanks for any assitance!