Data VataView and DataTable

xiaoxiao2021-03-06  20

DataView is used to create different views of the data stored in the DataTable, which is usually used for data binding applications. With DataView, you can publish data with different sorting sequences in the table, and you can filter data in line or filter-based expression.

DataView provides data dynamic views, its contents, sorting, and member relationships will reflect changes to the base DataTable in real time. It is different from DataTable's SELECT method, and the latter returns a DataRow array from the table, although its content reflects the changes to the base table, but its membership and sorting are static. DataView's dynamic features make it ideal for data binding applications.

Similar to the view provided by the database, DataView provides a dynamic view that provides you with a single dataset that can apply different sorting and filtering conditions. However, fairly differences between DataView and database views is that DataView cannot be processed as a table, and the view of the coupling table cannot be provided. In addition, it is not possible to exclude the columns existing in the source table, and it is not possible to add columns that do not exist in the source table (such as compute columns).

You can use DataViewManager to manage view settings of all tables in the DataSet. DataViewManager provides a convenient way to manage the default view settings for each table. Binding to DataViewManager is ideal choice when binding a control to a DataSet.

转载请注明原文地址:https://www.9cbs.com/read-44373.html

New Post(0)