Free mag vol1 | Page 861

CHAPTER 21  ADO.NET PART I: THE CONNECTED LAYER Table 21-3. Select Additional ADO.NET-Centric Namespaces Namespace Meaning in Life Microsoft.SqlServer. Server This namespace provides types that facilitate CLR and SQL Server 2005 and later integration services. System.Data This namespace defines the core ADO.NET types used by all data providers, including common interfaces and numerous types that represent the disconnected layer (e.g., DataSet and DataTable). System.Data.Common This namespace contains types shared between all ADO.NET data providers, including the common abstract base classes. System.Data.Sql This namespace contains types that allow you to discover Microsoft SQL Server instances installed on the current local network. System.Data.SqlTypes This namespace contains native data types used by Microsoft SQL Server. You can always use the corresponding CLR data types, but the SqlTypes are optimized to work with SQL Server (e.g., if your SQL Server database contains an integer value, you can represent it using either int or SqlTypes.SqlInt32). Note that this chapter does not examine every type within every ADO.NET namespace (that task would require a large book all by itself); however, it is quite important that you understand the types within the System.Data namespace. The Types of the System.Data Namespace Of all the ADO.NET namespaces, System.Data is the lowest common denominator. You cannot build ADO.NET applications without specifying this namespace in your data access applications. This namespace contains types that are shared among all ADO.NET data providers, regardless of the underlying data store. In addition to a number of database-centric exceptions (e.g., NoNullAllowedException, RowNotInTableException, and MissingPrimaryKeyException), System.Data contains types that represent various database primitives (e.g., tables, rows, columns, and constraints), as well as the common interfaces implemented by data provider objects. Table 21-4 lists some of the core types you should be aware of. 807