Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:46:35+00:00 2026-05-29T10:46:35+00:00

I have this valid query (in .Net4.0) that gets the still-open invoices: Dim dinvs

  • 0

I have this valid query (in .Net4.0) that gets the still-open invoices:

Dim dinvs = AcStudentInvoiceDetails _
            .GroupBy(Function(di) di.InvoiceID) _
            .Select(Function(di2) New With { _
                .InvoiceID = di2.Key, _
                .DebitSum = di2.Sum(Function(di3) di3.Debit), _
                .CreditSum = di2.Sum(Function(di3) di3.Credit) }) _
            .Where(Function(dd) dd.DebitSum > dd.CreditSum)

Dim invs = From i In AcStudentInvoices _
           Join di In dinvs On i.ID Equals di.InvoiceID _
           Select i

I tested this query on LinqPad, and it gets correct results, but LinqPad works on .Net 4.0, and my project works on .Net3.5, the error is that we have an anonymous object and in .Net3.5, Where can’t work with anonymous objects.

I tried to create a strongly-typed class instead of the anonymous object but I got lost in the syntax of Linq, so I need an equivalent for this query in .Net3.5

Error text excerpt:

Overload resolution failed because no accessible ‘Where’ can be called with these arguments:

Extension method ‘Public Function Where(predicate As System.Linq.Expressions.Expression(Of System.Func(Of <anonymous type>, Integer, Boolean))) As System.Linq.IQueryable(Of <anonymous type>)’ defined in ‘System.Linq.Queryable’: Nested function does not have the same signature as delegate ‘System.Func(Of <anonymous type>, Integer, Boolean)’…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:46:37+00:00Added an answer on May 29, 2026 at 10:46 am

    You should be able to do this with a strong type

    Public Class ST
       Public Property InvoiceID As String
       Public Property DebitSum As Double
       Public Property CrediSum As Double
    End Class
    

    Which Makes your query like this,

    Dim dinvs = AcStudentInvoiceDetails 
                .GroupBy(Function(di) di.InvoiceID) 
                .Select(Function(di2) New ST With { 
                    .InvoiceID = di2.Key, 
                    .DebitSum = di2.Sum(Function(di3) di3.Debit), 
                    .CreditSum = di2.Sum(Function(di3) di3.Credit) }) 
                .Where(Function(dd As ST) dd.DebitSum > dd.CreditSum)
    
    Dim invs = From i In AcStudentInvoices 
               Join di In dinvs On i.ID Equals di.InvoiceID 
               Select i
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this bind to my textfields onkeyup event: function ajaxSearch(sstring,miszerint,startrow,Valid,notValid) { setTimeout(function query(){
Right now I have this SQL query which is valid but always times out:
Thanks for looking on this problem. I have a page that is totally valid
I have this query that pulls email addresses from our DB. There is a
Okay, I have this in my Codeigniter controller: public function post($id) { $data['query'] =
Is this a valid http url http://www.example.com?x&y or we must always have = sign
I have a feeling this XML is not valid, can someone please explain why?
I have a valid reason for wanting to do this, but it's a long
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
I have a CI Model set up with this function and ActiveRecord: function get_open_competitions()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.