O'Reilly logo

Programming ASP.NET, Second Edition by Dan Hurwitz, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The ADO.NET Object Model

The goal of ADO.NET is to provide a bridge between your objects in ASP.NET and your back-end database. ADO.NET provides an object-oriented view into the database, encapsulating many of the database properties and relationships within ADO.NET objects. Further, and in many ways most important, the ADO.NET objects encapsulate and hide the details of database access; your objects can interact with ADO.NET objects without knowing or worrying about the details of how the data is moved to and from the database.

The DataSet Class

The ADO.NET object model is rich, but at its heart, is a fairly straightforward set of classes. The key class is the DataSet, which is located in the System.Data namespace.

The dataset represents a rich subset of the entire database, cached on your machine without a continuous connection to the database. Periodically, you’ll reconnect the dataset to its parent database, and update the database with changes to the dataset that you’ve made, and update the dataset with changes in the database made by other processes.

The dataset captures not just a few rows from a single table, but represents a set of tables with all the metadata necessary to represent the relationships and constraints among the tables recorded in the original database.

The dataset is comprised of DataTable objects as well as DataRelation objects. These are accessed as the Tables and Relations properties, respectively, of the DataSet object. The most important methods and properties ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required