?
Solved

C#: Updating DataSet with data from DataGrid to execute DataAdapter.Update.

Posted on 2007-04-02
3
Medium Priority
?
1,294 Views
Last Modified: 2013-11-07
I have crated a dataset from one table of an Access database which I'm using to populate a datagrid. I have setup the UpdateCommand and InsertCommand properties of the DataAdapter and have tested the insert functionality by programatically adding a row to the DataSet and executing the DataAdapter.Update method. This worked fine.

The bit I'm a bit confused about (as simple as I'm sure it is) is the logic of how to get updated or new rows from the DataGrid get update to the database. In one of the many articles I just read, of which none explicitly explain this detail, I saw mention of the fact that the DataGrid will automatically update the DataSet? From my brief experience of .NET, this doesn't make sense. I would assume I have to use an event from the datagrid to update the dataset.

Could someone let me know what event I should use, and how I can incorporate the data from the DataGrid into the DataSet. For some reason I just can't find any references on how to do this. Probably just too tired.
0
Comment
Question by:Esulin
[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
  • 2
3 Comments
 

Author Comment

by:Esulin
ID: 18836478
I'm in a bit of a hurry so bumping up the points.
0
 
LVL 21

Expert Comment

by:K V
ID: 18836738
if u just want to refill the grid with new data, just assign ds to grid's datasource after you add it to DB.
obv. you should refill the ds as well before assigning.
0
 
LVL 21

Accepted Solution

by:
K V earned 1500 total points
ID: 18836810
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

765 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