Not Queryable ?

Posted on 2011-04-19
Last Modified: 2012-05-11
Dim myDatesToCompare As New List(Of DateIndexMatching)


Dim finalMatches = From combo In (From _set In myDatesToCompare.OrderBy(Function(x) x.OfDate) Select _set).FirstOrDefault() _
                               Select combo

When I add FirstOrDefault to my LINQ I receive error   Expression of Type ......DateIndexMatching is not Queryable Make sure you are not missing assembly..blabla

Acutally its working great if I remove the firstOrDefault()  I am jsut trying to retrive only the first row of this query...

any idea?
Question by:PhilippeRenaud
    LVL 83

    Expert Comment

    May be you want this

    Dim finalMatches = (From combo In (From _set In myDatesToCompare.OrderBy(Function(x) x.OfDate) Select _set)).FirstOrDefault()
    LVL 1

    Author Comment

    with that i have error on the line   Select Combo

    saying  end of statement expectped
    LVL 83

    Accepted Solution

    I had removed Select combo.
    LVL 1

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now