In my application I need to fetch items from 2 SharePoint lists(ListA & ListB) as a listitem-collection and then I need to show items from ListA if the items in ListB matchs (ListA.empid == ListB.empid).
var iPs = AListItem.AsEnumerable()
.Select(r => r.FieldValues["EmpID"])
.Union(BListItem.AsEnumerable()
.Select(r => r.FieldValues["EmpID"]));
if (iPs.Count() > 0)
{
List<ListItem> sample = (from row in AListItem.AsEnumerable()
join id in iPs
on row.FieldValues["EmpID"] equals id
select row).ToList();
}
But i need result in datatable in order to bind to repeater control. How can I convert List<ListItem>
to datatable?