C # Dataset Index

I need to find records in a dataset that have specific values ​​from more than one column. I cannot use the Find or Contains method since they require a primary key and my search values ​​may not be unique. Does the DataSet have indexes (like an SQL table) that I can use to speed up my search? Right now I am going through a dataSet doing comparisons for each column, but this method is very slow (my data set has 600k rows).

thank

+1
source share
1 answer

You can use the DataTable selection method, which allows you to search according to your search criteria.

DataRow[] myRows = ds.Tables[0].Select("intCol=0 OR stringCol='yourSearch'");
+2

Source: https://habr.com/ru/post/1736138/


All Articles