1. Home
  2. Computing & Technology
  3. Visual Basic
Using ADO .NET - First Principles
Part 3: DataSet - King of ADO .NET Objects

The main new feature in ADO .NET is provided by the DataSet object. This object reads the database and creates an in-memory copy of that part of the database that your program needs. DataSet is a little (but only just a little) like the old Recordset object. Usually a DataSet object will correspond to a real database table or view (or perhaps several), but DataSet is a "disconnected" view of the database data. After ADO .NET creates the data set, there is no longer an active connection to the database. This helps a lot in scalability (when the amount of data that must be handled by the same program increases) because your program only has to connect with a database server when reading or writing from the database.

The old ADO also provided a limited and hard to use ability to operate in disconnected mode, but DataSet takes it to new heights. In addition to being more reliable and much easier to use, DataSet supports both a hierarchical view of the data as XML and a relational view that you can manage after disconnection.

Some have complained that ADO .NET doesn't support "server side cursors" (the ability to execute database commands on the server before a Recordset is created). Microsoft reasoned that this type of processing is nearly always done using stored procedures that are actually part of the database (in the case of SQL Server, these are written in a database language called Transact SQL) and you can trigger these from ADO .NET.

Some of the advantages of the new DataSet object are:

  • Read / Write
  • Connectionless
  • Contains one or more DataTable objects with relationships defined in a collection of DataRelation objects
  • Supports filtering and sorting
  • The contained DataView object can be bound to data-aware forms controls
  • Supports automatic XML serialization (creation of XML document)

As you can see, the DataSet object is a powerful new software tool and is a big part of the entire ADO .NET technology advancement.

Next page > The Xtra in ADO is XML! > Page 1, 2, 3, 4
Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.