Which of the following classes is an in-memory cache of data retrieved from a data source that
consists of a collection of DataTable objects that you can relate to each other with objects?
A.
DataRelation
B.
DataAdapter
C.
DataReader
D.
DataSet
Explanation:
DataSet is a memory-resident representation of data. It represents related tables, constraints, and
relationships among the tables. DataSet reads and writes data and schema as XML documents. It is
an in-memory cache of data retrieved from a data source that consists of a collection of DataTable
objects that you can relate to each other with objects.
Answer C is incorrect. DataReader is one of the .NET data providers of ADO.NET. It enables a user to
read data in a sequential manner. A DataReader object retrieves only read-only and forward-only
data and stores only one row of the data in memory at a time. The DataReader object enhances
application performance by retrieving data fast when being requested. ADO.NET infrastructure
provides specific .NET data providers for many DataReader classes. They include the OLE DB .NET
data provider for the OleDbDataReader class and the SQL Server .NET data provider for the
SqlDataReader class.
Answer A is incorrect. The DataRelation class represents a parent/child relationship between two
DataTable objects.
Answer B is incorrect. A DataAdapter in ADO.NET functions as a bridge between a data source, and
a disconnected data class, such as a DataSet. It is used to specify SQL commands that provide
elementary CRUD functionality. At a more advanced level it offers all the functions required in order
to create Strongly Typed DataSets, including DataRelations.