I have a piece of code:
var tblGroupedMultiPassive = dtCSV.AsEnumerable()
.Where(r => r.Field<String>("course_type_id") == "3")
.GroupBy(r => new
{
product_id = r.Field<String>("product_id"),
owner_org_id = r.Field<String>("owner_org_id"),
});
if (tblGroupedMultiPassive.Count() > 0)
dtCSVMultiSCOPassive = tblGroupedMultiPassive.Where(grp => grp.Count() > 1)
.SelectMany(grp => grp)
.CopyToDataTable();
Basically on the final statement where assigning to dtCSVMultiSCOPassive, it throws an exception for there being no rows. I know there are rows before this query so it's got to be the LINQ query itself eliminating all of the rows. This is fine, but I need to be able to deal with this situation without it becoming an exception. Any ideas?