Results 1 to 3 of 3

Thread: [RESOLVED] VS[2010]. Get DataRows with latest date using Group in LINQ

  1. #1

    Thread Starter
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Resolved [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?
    Last edited by jcis; Dec 9th, 2015 at 09:16 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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)()
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: VS[2010]. Get DataRows with latest date using Group in LINQ

    Thanks JM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width