Represents a databindable, customized view of a System.Data.DataTable for sorting, filtering, searching, editing, and navigation. The System.Data.DataView does not store data, but instead represents a connected view of its corresponding System.Data.DataTable. Changes to the System.Data.DataView’s data will affect the System.Data.DataTable. Changes to the System.Data.DataTable’s data will affect all System.Data.DataViews associated with it.
See Also: DataView Members
A major function of the System.Data.DataView is to allow for data binding on both Windows Forms and Web Forms.
Additionally, a System.Data.DataView can be customized to present a subset of data from the System.Data.DataTable. This capability lets you have two controls bound to the same System.Data.DataTable, but that show different versions of the data. For example, one control might be bound to a System.Data.DataView that shows all the rows in the table, and a second might be configured to display only the rows that have been deleted from the System.Data.DataTable. The System.Data.DataTable also has a DataTable.DefaultView property. This returns the default System.Data.DataView for the table. For example, if you want to create a custom view on the table, set the DataView.RowFilter on the System.Data.DataView returned by the DataTable.DefaultView.
You can also add and delete from the set of rows using the DataView.AddNew and DataView.Delete(int) methods. When you use those methods, the DataView.RowStateFilter property can set to specify that only deleted rows or new rows be displayed by the System.Data.DataView.
If you do not explicitly specify sort criteria for DataView, the DataRowView objects in DataView are sorted based on the index of DataView's corresponding DataRow in the DataTable.Rows DataRowCollection.
linq_dataset allows developers to create complex, powerful queries over a System.Data.DataSet by using vbteclinq. A linq_dataset query returns an enumeration of System.Data.DataRow objects, however, which is not easily used in a binding scenario. System.Data.DataView can be created from a linq_dataset query and takes on the filtering and sorting characteristics of that query. linq_dataset extends the functionality of the System.Data.DataView by providing vbteclinq expression-based filtering and sorting, which allows for much more complex and powerful filtering and sorting operations than string-based filtering and sorting. See Data Binding and LINQ to DataSet for more information.