Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vb.net 4 winform. Newbie; How do I save a record added in the datagridview?

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I created a local SQL database .SDF file and added a table which created a binding source.
I put in one record by opening the Server Explorer and the table, then “Show Table data” and added it there.
I added a form then added a Datagridview and used the Datagridview tasks to connect to the above binding source.

I run it and can see my one record in the Datagridview. I can type new data in the bottom row which has an * in the far left column ,but then it does not save it. If stop the program and then rerun it the new record is not there.

What do I need to do?

TIA


DougP
 
Right-click on the Table Adapter, then select "Edit Queries in DataSet Designer...". In the DataSet Designer double-click on the TableAdapter node in the left pane, then follow the Table Adapter Configuration Wizard. One of the wizard screens allows you to generate the Update, Insert and Delete commands.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Ok did that before I posted. So how do I call it?
If I type in new stuff on the blank line at the bottom with the asterisk it shows -1 in the "ID" column which is an Autoincrement ID. but it never saves anything. something needs to trigger the Insert it to save?
If I click off the row it does not save either.

DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top