That s Not ASP

IOTA^_^    

Sams Teach Yourself ASP.NET in 21 Days, Second Edition
By Chris Payne
Table of Contents
Day 10.  Communicating with ADO.NET


That's Not ASP!

If you're familiar with classic ASP or ADO, you might be wondering how your good old Recordset fits into all this.

Although the actual ADODB Recordset is a thing of the past, the concept is still there. In essence, a DataReader is simply a Recordset that uses a forward-only cursor, whereas the DataSet is a Recordset that uses a scrollable or dynamic cursor. The new ADO.NET objects are a bit more functional, of course, but the basic functionality is similar.

When working with a Recordset, regardless of the cursor type, you are continuously connected to the database, which requires locks on the data. This can be rather inefficient, especially if you have many concurrent users. The DataSet is a completely disconnected data store, which means you simply grab the data from the database and you're off and running; no need to maintain a connection to the database, no need to lock the data. In addition, the DataSet can represent much more about a data store than simply its data. As you learned today, DataSets can contain multiple tables (which is impossible with Recordsets), relationships, and mappings. This is a powerful new model for dealing with data, and might eliminate some database woes that were present with traditional ADO. All that functionality can come at a price, however. Therefore, you also have the OleDbDataReader, which more closely resembles the Recordset. The difference is that the former is completely object-oriented, and deals with type-safe data.

The OleDbConnection and OleDbCommand objects are very similar to the ADODB Connection and Command objects from traditional ADO, so you should feel fairly comfortable transitioning to them. Concepts that existed in classic ASP, such as transactions and parameter objects, still exist in ASP.NET. In fact, in Day 12, we'll examine these in more detail.

Although there are many differences between classic ADO and ADO.NET, there are also many similarities that will aid developers familiar with classic ADO. A large number of the changes in ADO.NET are simply to make the data model more coherent, flexible, and powerful.


    IOTA^_^    
    Top


    Sams Teach Yourself ASP. NET in 21 Days
    Sams Teach Yourself ASP.NET in 21 Days (2nd Edition)
    ISBN: 0672324458
    EAN: 2147483647
    Year: 2003
    Pages: 307
    Authors: Chris Payne

    Similar book on Amazon

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