How to filter Dataset
-
Hi all, I have a dataset which has 3 tables. They have relation by ds.Relations.Add(...) Now I want a filteration like a master table i.e. ds.tables(0) should be filtered by one column like ds.tables(0).Select("Site_ID = 5") (which will return datarow array now) and I want its children rows should be filtered appropriately. Instead of table.Select(...) is there any other way? Thank You
-
Hi all, I have a dataset which has 3 tables. They have relation by ds.Relations.Add(...) Now I want a filteration like a master table i.e. ds.tables(0) should be filtered by one column like ds.tables(0).Select("Site_ID = 5") (which will return datarow array now) and I want its children rows should be filtered appropriately. Instead of table.Select(...) is there any other way? Thank You
You could create a DataView-object for the DataTable via
DataView dv = new DataView(ds.Tables[0]);
. Then set the RowFilter with this linedv.RowFilter = "Site_ID = 5";