you could create an object representing the columns you want to show then you can do the below:
public class YourObject
{
public string Pror1 {get;set;}
public string Pror2 {get;set;}
}
List<YourObject> result=from row1 in dsResults.Tables[0].AsEnumerable()
join row2 in dsResults.Tables[1].AsEnumerable()
on row1.Field<decimal>("RecordId") equals row2.Field<decimal>("RecordId2")
select new YourObject()
{
Pror1=row1.prop1,
Prop2=row2.prop2,
......
}.ToList();
if you want to select all the column you can do the below
from row1 in dsResults.Tables[0].AsEnumerable()
join row2 in dsResults.Tables[1].AsEnumerable()
on row1.Field<decimal>("RecordId") equals row2.Field<decimal>("RecordId2")
select new { RowTable1 = row1, RowTable2 = row2}; //anonymous type
In this case each element of the result will have two properties: RowTable1
will be a row from row1
, and RowTable2
will be the matching row from row2