I have a DataSet which contains two tables, Publication and Owner, which are linked on Publication ID. How do I query the dataset? What I am trying to do is get all of the owners for a particular publication, and then I want to iterate over the resulting set, concatenate the owner names together and populate a label with the information…
But lets begin with, how do i query the dataset?
I also have a DataRelation, can I query that somehow to get the child rows for the current row?
Thanks.
ADO.NET supports two fundamental approaches for performing filtering and sorting of datasets:
The DataTable Select Method – This method is overloaded to accept arguments to filter and sort data rows returning an array of DataRow objects.
The DataView object sort, filter and find methods – This object uses the same filter arguments supported by the Select method, but the DataView exposes structures that can be bound to data-aware controls. See DataView.RowFilter
Iterating over filtered rows is as easy as:
This article contains several examples: A Practical Guide to .NET DataTables, DataSets and DataGrids – Part 1