The System.Data namespace contains most of ADO.NET's base objects, or the objects upon which ADO.NET relies to represent data retrieved from the data source. It also contains various supporting objects, such as many of the various ADO.NET exceptions (specific errors). Figure 1.3 shows how the various ADO.NET objects interrelate.
The DataSet object is the parent object to most of the other objects in the System.Data namespace. Its primary role is to store a collection of DataTable s, and the relations and constraints between those DataTable s. The DataSet also contains several methods for reading and writing XML, as well as merging other DataSet s, DataTable s, and DataRow s.
The DataTable stores a table of information, typically retrieved from a data source. In addition to simply containing the various DataColumn s and DataRow s, however, the DataTable also stores metatable information such as the primary key and constraints.
The DataRow and DataColumn objects are at the bottom of the ADO.NET "food chain," so to speak. Ordinarily, you won't have to deal with these objects in an application. However, as you'll see later in this book, there are instances where it is useful to drill down to the actual columns and rows in a DataTable .