Dela via


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

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.