[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2007-04-02
3
Medium Priority
?
1,299 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 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