Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 654
  • Last Modified:

VB.Net Saving Data in Datagridview to Access Database

Hi Experts.  I Have a DGV, a navigator and a bindingsource to an Access database.  The data shows correctly in the DGV and the navigator handles everything in the DGV correctly, such as adding and deleting rows, etc but I see no way of saving the edited DGV back to the Access databse.  Please can someone advise how this is done.  MAny Thanks in advance.
0
PNRT
Asked:
PNRT
1 Solution
 
nepaluzCommented:
show some code on how you are loading the data into your DataGridView. Also, have you a preference on how to save it back to Access? (e.g sql, LINQ etc ..)
0
 
David L. HansenProgrammer AnalystCommented:
It should automatically.
0
 
CodeCruiserCommented:
What are you feeding into the bindingsource? DataTable? Are you using a TableAdapter? You need to call the Update method on it.
0
 
PNRTAuthor Commented:
Hi, Im not using any code at all.    I created a dataset connected to an Access database.   I chose that dataset in the properties of the Datagridview and the bindingsource and the table adapter were created automatically.  I then connected the bindingnavigator to the binding source.   It all works correctly.  The data in the database appears in the datagridview and the navigator navigates the datagridview.   But new  entries in the datagridview are not being saved back to the database.  I thought sl8rz had it right that there would be an option for it to save back automatically?
0
 
CodeCruiserCommented:
There isn't. You need to call the Update method on the TableAdapter.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now