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 3975732
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:43:13+00:00 2026-05-20T04:43:13+00:00

Why can I do the following : Dim qNodes As IQueryable(Of XmlNode) = xDoc.ChildNodes.AsQueryable()

  • 0

Why can I do the following :

Dim qNodes As IQueryable(Of XmlNode) = xDoc.ChildNodes.AsQueryable()
Dim test = qNodes.Where(Function(node) True)

although the following gives the error I stated in the title :

Dim qNodes As IQueryable(Of XmlNode) = xDoc.ChildNodes.AsQueryable()
Dim test = qNodes.Where(Function(node)
                               Return True
                           End Function)

?

I really don’t get it.

  • 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-20T04:43:14+00:00Added an answer on May 20, 2026 at 4:43 am

    This is stated in section 11.1 of the VB.NET 10 Language Specification:

    The exact translation between lambda
    methods and expression trees may not
    be fixed between versions of the
    compiler and is beyond the scope of
    this specification. For Microsoft
    Visual Basic 10.0, all lambda
    expressions may be converted to
    expression trees subject to the
    following restrictions:

    1. Only single-line lambda expressions without ByRef parameters
      may be converted to expression trees.
      Of the single-line Sub lambdas, only
      invocation statements may be converted
      to expression trees.
    2. Anonymous type expressions cannot be converted to expression trees if an
      earlier field initializer is used to
      initialize a subsequent field
      initializer, e.g. New With {.a=1,
      .b=.a}
    3. Object initializer expressions cannot be converted to expression
      trees if a member of the current
      object being initialized is used in
      one of the field initializers, e.g.
      New C1 With {.a=1, .b=.Method1()}
    4. Multi-dimensional array creation expressions can only be converted to
      expression trees if they declare their
      element type explicitly.
    5. Late-binding expressions cannot be converted to expression trees.
    6. When a variable or field is passed ByRef to an invocation
      expression but does not have exactly
      the same type as the ByRef parameter,
      or when a property is passed ByRef,
      normal VB semantics are that a copy of
      the argument is passed ByRef and its
      final value is then copied back into
      the variable or field or property. In
      expression trees, the copy-back does
      not happen.

    All these restrictions apply to nested
    lambda expressions as well.

    It is the restriction in the first item that you are running into. The introduction leaves plenty room to assume that this will be worked on in future releases, there’s much to be gained of course. Connect.microsoft.com is a good place to go to encourage them. I couldn’t check if a feedback item was already opened for this, the site is on the fritz right now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've check everywhere and can't find a solution. I have the following Dim users
While learning to use LINQ in VB.NET, I came across the following: Dim x
Consider the following code: Dim arr1 As New List(Of Double) Dim arr2 As New
I have the following code: Dim compiler As ICodeCompiler = New Microsoft.JScript.JScriptCodeProvider().CreateCompiler Dim params
I am trying to get the value of local path by doing the following:
I have a function that takes in a number of parameters.. it then does
I am having some trouble trying to get a report to print from a
I try to get all user photo by using FQL (Facebook C# SDK, ASP
Is there a way to use CodeDom to generate an overloaded operator in Vb.net?

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.