Database Reference
In-Depth Information
Figure 15-8. Using a data view
How It Works
This program is basically the same as the other examples, so we'll focus on its use of a data view. You
create a new data view and initialize it by passing four parameters to its constructor.
// Create Data View
DataView dv = new DataView(dt,
"MiddleName = 'J.'",
"MiddleName",
DataViewRowState.CurrentRows);
The first parameter is a data table, the second is a filter for the contents of the data table, the third is
the sort column, and the fourth specifies the types of rows to include in the data view.
System.Data.DataViewRowState is an enumeration of states that rows can have in a data view's
underlying data table. Table 15-1 summarizes the states.
 
Search WWH ::




Custom Search