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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:08:53+00:00 2026-05-30T10:08:53+00:00

I recently switched from VB to C# and have, for the most part, been

  • 0

I recently switched from VB to C# and have, for the most part, been able to make the transition without too much trouble. Currently I am working on converting a VB.Net program into C# and am having trouble with a couple of code blocks that include Linq.

This is one of the VB.Net lines of code that I am having trouble with:

Dim emails = From em In dt Group By email = em(1) Into Emailers = Group 

I have tried to do the same thing in C# like this:

var emails = 
    from em in dt
    group emails = em[1] 
    into Emailers = group;

I am getting a compile error on the dt, which says Could not find an implementation of the query pattern for source type ‘System.Data.DataTable’.’GroupBy’ not found. VS also has issues with the whole into Emailers = group;

I have tried to get this right using examples from my search but have not been able to get it right. How should that be converted?

  • 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-30T10:08:55+00:00Added an answer on May 30, 2026 at 10:08 am

    There are two problems:

    • The query syntax is incorrect
    • You’re trying to use DataTable directly; DataTable doesn’t implement IEnumerable<T> which is why it’s failing in C#. (Presumably VB handles DataTable specially somehow.)

    My VB is rubbish, particularly for LINQ, so I don’t understand the query – but it looks like you’re just trying to group the rows by one column. If that’s the case, it’s as simple as:

    var emails = from em in dt.AsEnumerable()
                 group em by em[1];
    

    Or even:

    var emails = dt.AsEnumerable().GroupBy(em => em[1]);
    

    Make sure you have:

    using System.Data;
    

    in your code, so that it’ll pick up AsEnumerable from DataTableExtensions.

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

Sidebar

Related Questions

I have been using rspec for a little while and recently switched style from
i recently switched from cs5.5 to FlashDevelop and i have trouble publishing my app
We just recently switched from Visual Studio 2008 to Visual Studio 2010. I have
I recently switched back from Java and Ruby to C++, and much to my
We have a WCF service that we recently switched from self-hosting to IIS-hosted. It
The project I work on has recently been switched from a horribly antiquated revision
Recently, I switched my development environment from Windows to Linux. So far, I have
I have recently switched from Netbeans to Eclipse. I have a project which contains
We have a C# application written in C# and recently switched over from MbUnit
I recently switched from intermediate mode and have a new rendering process. There must

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.