This chapter focuses on searching for records in views and tables, calculating values based on values in the same or other tables, and navigating data relations between tables.
DataView is a data-bindable view of a
DataTable that presents data with different sort
orders and filters. You can create multiple views for each table;
every table has a default data view. The
DataViewManager class helps to manage the default
data views for tables in a
DataSet. Recipe 3.1 demonstrates how to use the
class to filter and sort data in a
DataSet. Recipe 3.12 shows how to filter a data view for rows
that have null values.
DataRelation class creates a parent/child
relation between two tables in a
DataRelation maintains referential integrity and
you can use it to cascade updates and deletes. It can also be used to
navigate between the tables. Recipe 3.4
shows how to use the data relation to get the parent row and the
child rows for any row.
classes both provide several ways to locate records from specified
criteria. Searching an existing table or view saves a roundtrip to
the database server. Although the
created from a
DataTable, searching is done
differently in each. Recipe 3.8 shows how to
find rows in a
DataTable while Recipe 3.9 shows how to find rows in a
DataView. You can create a
DataView from a typed
to search or filter. Recipe 3.11 shows how ...