Searching for data in a dataset

Source: Internet
Author: User

Searching for data in a dataset

Using an indexed (index-based) View table improves performance when querying rows that meet specific criteria in a dataset. When you assign a primary key (PrimaryKey) value to a datasheet, an index is established. Indexing is also established when a Data View (DataView) is established for a datasheet. Here are some tips for using indexed viewing:

If the query is on the primary key column of the datasheet, use DataTable.Rows.Find instead of datatable.select.

Query for non-primary key columns, you can use a data view to increase the speed of multiple data queries. When you add a sort to a data view, the index used for the search is established. The Data view exposes the find and FindRows methods for querying the underlying data tables.

If you are not a sort view of a query table, you can also gain an indexed view table by creating a data view for the datasheet. Note that if you execute multiple queries on the data, this is the only benefit. If you are only performing a single query, the process of indexing will degrade performance by using indexes.

Data View (DATAVIEW) structure

When the Data view is established, and when the sort, rowfilter, or RowStateFilter or properties are modified, the Data View indexes the data in the underlying datasheet. When you create a Data View object, you use a Data view constructor that takes the sort, rowfilter, and RowStateFilter values as parameters. As a result, an index was established. Establishing an "empty" Data View and then setting the sort, RowFilter, and RowStateFilter properties will result in indexing at least two times.

PS: You can continue to select in the dataset. and returns a DataTable.

DataView can you customize the filter. (filtered with SQL statement)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.