Solved

VB.Net  Saving Data in Datagridview to Access Database

Posted on 2011-09-22
5
616 Views
Last Modified: 2012-05-12
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
Comment
Question by:PNRT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 17

Expert Comment

by:nepaluz
ID: 36581164
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
 
LVL 15

Expert Comment

by:David L. Hansen
ID: 36581296
It should automatically.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 36582126
What are you feeding into the bindingsource? DataTable? Are you using a TableAdapter? You need to call the Update method on it.
0
 
LVL 2

Author Comment

by:PNRT
ID: 36583123
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
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 36593822
There isn't. You need to call the Update method on the TableAdapter.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question