I am getting this error and I have collection of anonymous Datarows and each item contains two datarows. How to cast this?
Unable to cast object of type 'WhereSelectEnumerableIterator`2[VB$AnonymousType_0`2[System.Data.DataRow,System.Data.DataRow],VB$AnonymousType_0`2[System.Data.DataRow,System.Data.DataRow]]' to type 'System.Data.EnumerableRowCollection'.
here is a query that I am using
From d In DBDataTable.AsEnumerable _
Join r In ReportDataTable.AsEnumerable _
On Trim(r.Field(Of String)(id)) Equals Trim(d.Field(Of String)("id")) _
Where _
d.Field(Of Integer)("TId") = tId _
And r.IsNull(DateCol) = False _
AndAlso Convert.ToDateTime(r.Field(Of Object)(DateCol)).ToShortDateString() = Convert.ToDateTime(d.Field(Of Object)("DateCol")).ToShortDateString() _
Order By d.Field(Of Integer)("ID") _
Select d, r
After this query I am getting a collection of Anonymous type with two Datarows with in each item of collection and basically I want to use that collection or looping through it, that's what I am trying to do.
Please help!