[RESOLVED] VS[2010]. Get DataRows with latest date using Group in LINQ
I want to do exactly what is explained HERE The answer there is what i need, but it seems Datatables don't implement AsEnumerable() in VS2010, any ideas?
Re: VS[2010]. Get DataRows with latest date using Group in LINQ
DataTables don't implement AsEnumerable anywhere. It's an extension method, which specifically means that it's not implemented by the type you call it on. AsEnumerable is a member of the System.Data.DataTableExtensions class, which is declared in the System.Data.DataSetExtensions.dll assembly. If you haven't referenced that assembly then you don't have access to that method. It's also LINQ so you need .NET 3.5 or higher.
That said, this:
Code:
myDataTable.AsEnumerable()
is basically equivalent to this:
Code:
myDataTable.Rows.Cast(Of DataRow)()
Re: VS[2010]. Get DataRows with latest date using Group in LINQ