I am reading through an Excel file in C#. There are 3 sheets in the file:
- Summary
- Users
- Others
I am looping through the columns of Summary sheet.(code below)
There is a column: SummaryID
in every sheet.
foreach (DataColumn dc in Summary.Columns)
{
foreach (DataRow dr in Summary.AsEnumerable())
{
//get column SummaryID for everyrow
//And then get all rows in Users sheet that match SummaryID
//And then get all rows in Others sheet that match SummaryID
}
}
My question is: for everyrow in Summary Sheet (SummaryID), I want to get all matching rows that match the SummaryID in 'Users' and 'Others' sheets.
Note: The column SummaryID
exists in all 3 sheets and is the first column in all sheets.