Consuming and Manipulating Data with ADO.NET

The System.Data namespace in the .NET Framework class library provides the classes that you need to work with data and databases. The primary distinction to be made among the ADO.NET objects is whether the objects directly connect to a specific type of database (as the Connection, Command, or DataAdapter objects do) or whether the objects are used by the client application in a disconnected manner. The DataSet object is meant to be used as a disconnected data store. The DataSet is similar to the disconnected recordset in the classic ADO object model, but it has even greater functionality. The System.Data namespace directly contains the DataSet class and its supporting objects, such as DataTables, DataRows, DataColumns, DataViews, and others.

Note 

The DataSet and the related classes are the subject of Chapter 6, which covers working with disconnected data in detail.

The System.Data namespace contains additional, more specialized namespaces such as System.Data.SqlClient and System.Data.OleDb. Their classes are designed to connect directly to different categories of databases. The differences between these specialized namespaces are discussed in the next section. For the most part, each namespace contains an equivalent set of classes, which work the same way. There are a few minor differences in the way that the classes have been implemented. One detail that you might notice right away is that the objects are named differently. When you use the class names in your code, you will actually use either a SqlConnection object or an OleDbConnection object. As you read the rest of this chapter, keep in mind that in general discussion we use a generic name of Connection or Command, but in code examples or when discussing a specific class, we use their proper names.

Note 

After you are familiar with using the classes in the System.Data.SqlClient namespace, for example, it should not be difficult to write an application that targets a database other than Microsoft SQL Server 2000 and requires the use of the System.Data.OleDb classes. The examples in this chapter use the System.Data.SqlClient classes for consistency.



MCAD/MCSD(c) Visual Basic. NET XML Web Services and Server Components Study Guide
MCAD/MCSD: Visual Basic .NET XML Web Services and Server Components Study Guide
ISBN: 0782141935
EAN: 2147483647
Year: 2005
Pages: 153

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net