Chapter 13. Strongly Typed DataSets
a collection of classes that inherit from the
DataRow classes, and provide additional
properties, methods, and events based on the
DataSet schema. These methods, properties, and
events allow, among other things, named properties and methods to be
used to retrieve column values, access parent and child records, find
rows, and handle null column values.
It is important to remember that strongly typed
DataSets are in fact just a collection of classes.
Because the strongly typed
DataSet classes inherit
DataRow, all the functionality present in those
classes can be used just as it is for the untyped classes. The
development environment just provides a way to automatically generate
consistent and efficient strongly typed
Using a strongly typed
DataSet has a number of
advantages over using untyped
Schema information is contained within the strongly typed
DataSet. This results in an improvement in performance over retrieving schema information at runtime. Of course, the schema of an untyped
DataSetcan also be defined programmatically.
Programming is more intuitive, and code is easier to maintain. Table and field names are accessed through properties rather than indexer arguments. The Visual Studio .NET IDE provides autocomplete functionality for these names. As an example, the following code demonstrates accessing data using both an untyped and strongly ...