Game Development Reference
ADO.NET Object Model
The ADO.NET object model is divided into a couple of group classifications: con-
tent components and managed provider components. The content components
are those that actually store the data. These components include the DataSet ,
DataView , DataTable , DataRelation , DataColumn , and DataRow classes. The managed
provider components are those that communicate with the data sources to facili-
tate the retrieval and updating of data. These components include the various con-
nection, command, and data reader classes. In fact, managed provider compo-
nents themselves are divided into two group classifications. The first group con-
tains provider components that interface with regular data sources
( System.Data.OleDb ). The second group contains a provider that is finely tuned and
optimized for use with SQL Server 2000 or higher ( System.Data.SqlClient ).
The DataView class is quite similar to a view you would use in the database. A
DataView can be customized to display a subset of data from a DataTable class. This
feature allows you to have two controls bound to the same DataTable object but
showing a different subset of data. You can also apply filtering and sorting rules
against the data rows without altering the actual data itself. For example, you can
configure a DataView to only show rows that have been deleted from a DataTable .
The DataSet class is very similar to the old Recordset class that existed in ADO,
except it can hold multiple tables of data. The DataSet class also has the ability to
define internal constraints and relationships, as well as enforcing them. DataSet
serves as a storage container for data traveling to and from the database.
In addition to database usage, you can also use a DataSet to load and manipulate
XML data. Microsoft recognizes that the industry has largely embraced the use of
XML for cross-platform communication, and so it has built a number of classes to
work with XML data (including the DataSet class).
You can access the XML functionality of the DataSet class with the ReadXml() ,
WriteXml() , and GetXml() methods.