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

  • Home
  • SEARCH
  • 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 6352519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:13:16+00:00 2026-05-24T22:13:16+00:00

Given the following table, as an example: +—-+———+———–+ | ID | GroupID | OtherData

  • 0

Given the following table, as an example:

+----+---------+-----------+
| ID | GroupID | OtherData |
+----+---------+-----------+
| 1  | 1       | w4ij6u    |
+----+---------+-----------+
| 2  | 2       | ai6465    |
+----+---------+-----------+
| 3  | 2       | ows64rg   |
+----+---------+-----------+
| 4  | 2       | wqoi46suj |
+----+---------+-----------+
| 5  | 3       | w9rthzv   |
+----+---------+-----------+
| 6  | 3       | 03ehsat   |
+----+---------+-----------+
| 7  | 4       | w469ia    |
+----+---------+-----------+
| 8  | 5       | nhwh57rt  |
+----+---------+-----------+
| 9  | 5       | mwitgjhx4 |
+----+---------+-----------+

How can I efficiently get a List<List<DataRow>> extracted from this table that is based upon the “GroupID” column?

Basically, I want the result to be:

MyList(0) = List: 1 DataRow, ID(s) 1
MyList(1) = List: 3 DataRows, ID(s) 2,3,4
MyList(2) = List: 2 DataRows, ID(s) 5,6
MyList(3) = List: 1 DataRow, ID(s) 7
MyList(4) = List: 2 DataRows, ID(s) 8,9

Here’s the problem though: This DataTable contains hundreds of columns and tens of thousands of rows, so this operation must be as efficient as possible.

I have already tried the following methods:

  • Creating a DataView with a Row Filter, and extracting a table/list of rows from that view.
  • A Linq query within a loop, after getting a unique list of GroupIDs. The Linq query selects each “set” of GroupIDs based on a Where clause.

I’m hoping someone else has a better, more efficient way of extracting this data.

  • 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-24T22:13:17+00:00Added an answer on May 24, 2026 at 10:13 pm

    Turns out that A) My returning data set was too large (because of a bug), and B) LINQ is probably the fastest way to do this, without writing some very long or hack-ish code. Thanks for your ideas, everyone, but I’ll stick with LINQ for now.

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

Sidebar

Related Questions

Given the following example table: <ul class=topnav> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
Given the following table in SQL Server 2005: ID Col1 Col2 Col3 -- ----
This came up when answering another user's question (TheSoftwareJedi)... Given the following table: ROW_PRIORITY
Given the following html table and script shown below I am having a problem
Given the following: declare @a table ( pkid int, value int ) declare @b
Given an Oracle table created using the following: CREATE TABLE Log(WhenAdded TIMESTAMP(6) WITH TIME
Given the one-table design given below how would the following best be queried The
Given a table (id, col1, col2), does it make sense to create the following
I have a necessity to sort a given HTML table of the following structure,
I got following question on an interview: Given a table of natural numbers with

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.