Search data in DataSet

xiaoxiao2021-03-06  94

Search data in DataSet

Using an index-based view table will increase performance when querying rows that match specific conditions. When you specify a primarykey value, an index is established when you specify a primary key. An index is also established when establishing a data view (DataView) for the data table. Here are some techniques that use index-based conditions:

If the query is performed on the primary key column of the data table, use DataTable.Rows.Find instead of DataTable.select.

Query non-main keys, you can use the data view to increase the speed of multiple data queries. When you add a sort to the data view, the index used when searching is established. The data view exposes the Find and Findrows methods for query the underlying data table.

If you are not a sorting view of the query table, you can also get the benefits of an index-based viewing table by building a data view for the data table. Note that if you perform multiple queries on your data, this is the only benefit. If you only perform a single query, you need to build an index will reduce performance because of the use of indexes.

Data View (DataView) structure

When the data view is established, and when the sort, rowfilter or rowstatefilter or attribute is modified, the data view is the data set index in the lower data table. When establishing a data view object, use the data view constructor of the Sort, RowFilter, and RowStateFilter values ​​as the parameters. The result is a set of indexes. Create a "empty" data view, then set the sort, rowfilter, and rowstatefilter properties will result in at least two indexes.

PS: Can you continue in DataSet SELECT? Return to a DataTable?

Can DataView custom filter? (Filtered with SQL statement)

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

New Post(0)