How to query a DataSet and iterate over the result?

I have a DataSet that contains two tables: Publication and Owner, which are associated with the publication identifier. How to request a data set? What I'm trying to do is get all the owners for a particular publication, and then I want to iterate over the result, combine the owner names together and fill in the label with information ...

But let's start with how can I query a dataset?

I also have a DataRelation, can I query to somehow get the child rows for the current row?

Thanks.

+5
source share
2 answers

ADO.NET supports two main approaches for filtering and sorting datasets:

DataTable. , , DataRow.

, DataView. , Select, DataView , , . . DataView.RowFilter

, :

DataTable dt;
...
foreach (DataRow dr in dt.Select(filter))
{
    // ...
}

: .NET DataTables, DataSet DataGrids - 1

+6
+3

All Articles