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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:26:32+00:00 2026-05-23T09:26:32+00:00

Again , just out of curiosity: After I have programmed several projects in VB.Net

  • 0

Again, just out of curiosity:

After I have programmed several projects in VB.Net I to my surprise discovered that there are some more than subtle differences between C# and VB.NET LINQ usage.
For example, if we want to group elements by multiple properties (columns) we need to create a new anonymous type explicitly:

var procs = from c in Process.GetProcesses() 
            group c by new {c.BasePriority, c.Id} into d 
            select d;

whereas in VB.NET more straightforward syntax will already do:

Dim b = From c In Process.GetProcesses()
        Group c By c.BasePriority, c.Id Into Group
        Select Group

So, one does not need to create a type with “new” here.

What are the other differences? Is there any good comparison between the LINQ syntax in C# and VB.NET?

  • 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-23T09:26:32+00:00Added an answer on May 23, 2026 at 9:26 am

    There are some differences that I know of, mostly that VB.NET’s LINQ has some hidden gems:

    1. Not explicitly LINQ related, but VB.NET supports the Key modifier on anonymous types. This allows you to define which properties in the anonymous type are used when comparing anonymous types. As far as I can tell with C#; it uses everything. This is where VB.NET has an actual advantage.
    2. VB.NET supports the Skip operation as a keyword:
      Dim returnCustomers = From a In list Skip numToSkip Select a You can do this in C#; but it has to be through the extension method, there is no syntactic sugar.
    3. VB.NET LINQ also supports Skip While: From a In list Skip While someCondition Select a Again, C# can do this; but only through the extension method.
    4. and 4.5.: The same as 2 & 3 except with Take and Take While
    5. The Select keyword is optional in VB.NET. If you want to select what is current; then that works fine: Dim shortWords = From l In list Where l.Length < 10 in C#; the Select part is required: var shortWords = from l in list where l.Length < 10 select l

    Those are the additional “features” of VB.NET’s LINQ that I am aware of.

    For example; with C#:

    var skip10 = (from c in customers select c).Skip(10);
    

    And in VB.NET

    Dim skip10 = From c In Customers Skip 10
    

    You can see the documentation for all of these here: http://msdn.microsoft.com/en-us/library/ksh7h19t(v=VS.90).aspx

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

Sidebar

Related Questions

I just figured out that I have a problem in IE while working with
I have MacPorts and CPAN installed and I've only just found out that it's
Ok. I'm stuck once again and it seems that internet just ran out of
EDIT AGAIN ... I'm just a dummy and figured it out! EDIT: So, it
I need some help with jQuery script again :-) Just trying to play with
Just out of curiosity I decided to write a simple tool with the functionality
So I am just trying out the Jsoup API and have a simple question.
My backend is PHP I have a service that I want to put out
I have to read the tomcat log file,and after some time(for example:one hour) I
Nevermind, I just figured out that CakePHP had to re-set the cookie because it

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.