Editing Data in Your Application
After your dataset is populated with data, you will typically add, edit, or delete some of the data before sending it back to the data source or to another process or application. Since each record in a dataset is represented by a DataRow object, changes to a dataset are accomplished by working with individual rows.
Note |
|---|
| In Windows Forms, the data-binding architecture takes care of sending changes from data-bound controls to the dataset, and you do not have to explicitly update the dataset with your own code. For more information, see Windows Forms Data Binding. |
Datasets maintain multiple versions of data rows in order to locate the original records in a data source. Before performing an update to the data source, you may want to examine specific rows. The topics in this section provide details on determining if records have changed, as well as retrieving particular versions of records.
The following topics provide details on adding, editing, and deleting rows in data tables, and how to work with rows in various stages of an application.
In This Section
- Editing Data in Datasets Overview
-
Provides information on the many tasks that manipulate data in a dataset.
- How to: Add Rows to a DataTable
-
Provides the steps to create DataRow objects and add them to a data table.
- How to: Edit Rows in a DataTable
-
Provides the steps for editing an existing row of data in a data table.
- How to: Delete Rows in a DataTable
-
Provides the steps to remove specific rows of data in a data table.
- How to: Turn Off Constraints While Filling a Dataset
-
Provides details for temporarily disabling constraint checking in a dataset.
- How to: Commit Changes in a Dataset
-
Provides information and details for accepting changes that have been made to data in a dataset.
- How to: Check for Changed Rows
-
Provides the steps to determine if data has been changed in a dataset.
- How to: Retrieve Changed Rows
-
Provides details for returning rows of data that have been changed since last accepting any changes.
- How to: Locate a Specific Row in a DataTable
-
Provides details for finding data in a data table using either a primary key value, or a column value.
- How to: Get Specific Versions of a DataRow
-
Provides details for returning specific rows of data using the DataRowVersion enumeration.
- How to: Locate Rows that Have Errors
-
Provides details for finding data in a data table that has been marked with an error.
Reference
- DataSet
-
Represents an in-memory cache of data.
- DataTable
-
Represents one table of in-memory data.
- DataRow
-
Represents a row of data in a DataTable.
- DataColumn
-
Represents the schema of a column in a DataTable.
- DataRowVersion
-
Describes the version of a DataRow.
- RowState
-
Gets the state of a DataRow object.
- AcceptChanges
-
Commits all the changes made to this DataSet since it was loaded or since the last time AcceptChanges was called.
- HasChanges
-
Gets a value indicating whether the DataSet has changes, including new, deleted, or modified rows.
- GetChanges
-
Gets a copy of the DataSet containing all changes made to it since it was last loaded, or since AcceptChanges was called.
- HasErrors
-
Gets a value indicating whether there are errors in any of the DataTable objects within this DataSet.
Note