Summary

   

The comparison chart in Table 9.4 summarizes the improvements in ADO.NET over ADO.

Table 9.4. The Improvements of ADO.NET Over ADO

Feature

ADO

ADO.NET

In-memory data representation (where data is cached in memory)

Uses a RecordSet object that represents a single table.

Uses a DataSet object that can contain one or more tables represented by the DataTable object. The ADO RecordSet object has been eliminated.

Relationships between tables

Requires a SQL JOIN query to pull together data from multiple tables into a single table.

Uses a DataRelation object to associate rows in one DataTable to rows in another DataTable .

Data access

Uses the MoveFirst and MoveNext commands to iterate through a RecordSet .

Uses a DataReader object to sequence through data. The Read method automatically advances through the DataSet and sets its initial starting point.

Disconnected data access

The RecordSet can support disconnected and connected access by using the Connection object and communicating with an OLE DB provider.

Uses the DataAdapter object to communicate with a database by calling a standard OLE DB provider or an API from a third party.

Programmability

Requires that the table and column methods be used to access data and that table and column names be specified.

Much easier to read and write because the data is self-describing in that it makes use of strongly typed program characteristics of XML. Thus, tables and rows do not appear in the actual code.

Data sharing

Disconnected RecordSets are transmitted using COM marshalling. These RecordSets support only the types defined by the COM standard. May require type conversions when passing data to different schemas.

Data is passed as an XML file, which imposes no restrictions on data types and requires no type conversions.

Passing data through firewalls

Might not work because most firewals are configured to deny system-level requests such as COM marshalling.

The DataSet object supports HTML-based XML, which will pass through firewalls.

Scalability

Does not easily scale well because of locks and open connections being used for extended periods.

Locks and connections are limited to very short durations because they use disconnected data access.

From the table and the chapter contents, you can see the ADO.NET environment provides many new features that were not available in the former ADO model. As you begin developing with ADO.NET you will soon realize there is a component for almost anything you want to accomplish, whether it's storing multiple tables using the DataSet object or taking advantage of its error-handling capability. As you work with ADO.NET, you will find it to be more powerful, flexible, and scalable.

In the next chapter, you will continue working with ADO.NET by looking at data binding to ASP.NET objects and how to use XML directly with DataSets.

   


Special Edition Using ASP. NET
Special Edition Using ASP.Net
ISBN: 0789725606
EAN: 2147483647
Year: 2002
Pages: 233

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