0% found this document useful (0 votes)
13 views3 pages

Dataset Object Model: Using XML in A Dataset Dataset

The document discusses ADO.NET DataSets, which allow for disconnected data access by storing data in memory. A DataSet contains one or more related DataTables that represent database tables. Each DataTable contains DataRows that represent table rows. DataRelations define relationships between tables. DataSets can load and save data and schema as XML. They provide a consistent programming model for working with data from multiple sources in memory.

Uploaded by

Supriya D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Dataset Object Model: Using XML in A Dataset Dataset

The document discusses ADO.NET DataSets, which allow for disconnected data access by storing data in memory. A DataSet contains one or more related DataTables that represent database tables. Each DataTable contains DataRows that represent table rows. DataRelations define relationships between tables. DataSets can load and save data and schema as XML. They provide a consistent programming model for working with data from multiple sources in memory.

Uploaded by

Supriya D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ADO.

NET DataSets

ADO.NET DataSet
It is a collection of data tables that contain the data. It is used to fetch data without interacting
with a Data Source that's why, it also known as disconnected data access method. It is an in-
memory data store that can hold more than one table at the same time. We can use DataRelation
object to relate these tables. The DataSet can also be used to read and write data as XML
document.ADO.NET provides a DataSet class that can be used to create DataSet object. It
contains constructors and methods to perform data related operations.

DataSet Object Model


The methods and objects in a DataSet are consistent with those in the relational database
model.The DataSet can also persist and reload its contents as XML, and its schema as XML
schema definition language (XSD) schema. For more information, see Using XML in a DataSet.

The DataSet object is central to supporting disconnected, distributed data scenarios with
ADO.NET. The DataSet is a memory-resident representation of data that provides a consistent
relational programming model regardless of the data source. It can be used with multiple and
differing data sources, with XML data, or to manage data local to the application.
The DataSet represents a complete set of data, including related tables, constraints, and
relationships among the tables. The following illustration shows the DataSet object model.
DataTables
DataSet is made up of a collection of tables, relationships, and constraints. In
ADO.NET, DataTable objects are used to represent the tables in a DataSet.
A DataTable represents one table of in-memory relational data; the data is local to the
.NET-based application in which it resides, but can be populated from a data source
such as Microsoft SQL Server using a DataAdapter For more information,
see Populating a DataSet from a DataAdapter.

Methods of C# DataTable in ADO.NET:


1. AcceptChanges(): It is used to commit all the changes made to this table.
2. Rows: It is used to get the collection of rows that belong to this table.

A DataRow represent a row of data in data table. You add data to the data table using DataRow
object. A DataRowCollection object represents a collection of data rows of a data table. You use
DataTable's NewRow method to return a DataRow object of data table, add values to the data
row and add a row to the data Table again by using DataRowCollection's Add method.
The DataTableCollection
An ADO.NET DataSet contains a collection of zero or more tables represented
by DataTable objects. The DataTableCollection contains all the DataTable objects in a DataSet.

A DataTable is defined in the System.Data namespace and represents a single table of memory-
resident data. It contains a collection of columns represented by a DataColumnCollection, and
constraints represented by a ConstraintCollection, which together define the schema of the table.
A DataTable also contains a collection of rows represented by the DataRowCollection, which
contains the data in the table. Along with its current state, a DataRow retains both its current and
original versions to identify changes to the values stored in the row.

You might also like