Hi testcode-2745,
- To index a DataTable, you need to specify an array of DataColumns, which form the unique key of the records in the DataTable.
More details you can refer to this document. - Creating a new DataView object may consume a lot of resources.
A DataView provides a dynamic view of data in the underlying DataTable. And DataView also provides you with a dynamic view of a single set of data, much like a database view, to which you can apply different sorting and filtering criteria. - There are two ways to create a DataView. You can use the DataView constructor, or you can create a reference to the DefaultView property of the DataTable.
When you create a data view through the constructor, you can provide any initial sorting or filtering criteria through the constructor parameters to achieve the best performance when you create the data view. Creating a DataView without specifying sorting or filtering conditions, and then setting the Sort, RowFilter, or RowStateFilter properties will cause the index to be built at least twice.
Here is a related document.
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.