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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:25:27+00:00 2026-06-10T20:25:27+00:00

I have the following query that returns exactly what I need, var dataRows =

  • 0

I have the following query that returns exactly what I need,

var dataRows = 
            (from headerLocationRow in headerLocationDataTable
             select WellsDao.Instance.GetAllWellData(headerLocationRow.HEADER_ID).WELL_BORE_CONSOLIDATED)
             .SelectMany(x => x.Select());

but I don’t like how it mixes the inline query with extension methods. This is for an older project, so I’m stuck with strongly-typed DataSets. I tried to use two from statements, but it didn’t like that. headerLocationDataTable is a strongly-typed DataTable. That WellsDao.Instance.Get… nonsense traverses the DataSet and returns a collection of DataTables strongly-typed as WELL_BORE_CONSOLIDATED based on the HEADER_ID field in the headerLocationDataTable.

This isn’t a huge deal because the query works, but I’m really trying to get a handle on LINQ, so I just want to know how to do this whole thing as inline. Or if you know of a more elegant way of writing this, please share. Ultimately, I want to get back a flat list of DataRows that contains all of the WELL_BORE_CONSOLIDATED rows, regardless of which parent headerLocationRow they are associated with.

  • 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-06-10T20:25:28+00:00Added an answer on June 10, 2026 at 8:25 pm

    This should do what you want:

    var dataRows =  from headerLocationRow in headerLocationDataTable
                    from wbcRow in WellsDao.Instance.GetAllWellData(headerLocationRow.HEADER_ID).WELL_BORE_CONSOLIDATED
                    select wbcRow;
    

    It’s the query syntax of a SelectMany.

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

Sidebar

Related Questions

I have the following query that returns 1738 rows: select a.street, b.id from TableA
I have the following query that works well. SELECT DISTINCT city,region1,region2 from static_geo_world where
I have following SQL query that selects some results from my table: select avg(c3),
I have following query which has select query that returns data in 5sec. But
I have the following query that retrieve the number of users per country; SELECT
I have the following query that performs a AND on-demand: var products = //
I have the following simple query that I execute on a SQLite3 database: SELECT
Assume I have the following query against the AdventureWorks DB: var result = from
I have a need to create a LINQ query that returns results based on
I have the following code var query = from lookup in dataset.Tables[MBDDX_LOOKUP].AsEnumerable() where lookup.Field<string>(lookup_value)

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.