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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:35:35+00:00 2026-06-10T02:35:35+00:00

I have a table that is 200 columns wide and need to return the

  • 0

I have a table that is 200 columns wide and need to return the data of a specific row and column but I won’t know the column until runtime. I can easily get the row I want into either a list, an individual strongly typed object, or an Array through LINQ but I can’t for the life of me figure out how to find the column I need.

So For instance (on a smaller scale) my table looks like this

GrowerKey | day1 | day2 | day3  | day4 |
-----------------------------------------
  3       |  1   |   3  |   2   |   2 |
  4       |  6   |   1  |   9   |   1 |
  5       |  8   |   8  |   2   |   4 |

and I can get the row I want with something simple like this

Dim CleanRecord As List(Of Grower_Clean_Schedule) = (From key In eng.Grower_Clean_Schedules
                                                     Where key.Grower_Key = Grower_Key).ToList

how do I then return only the value of a specific column of that row (like say the value stored in “day2”) When I won’t know which column until runtime?

  • 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-10T02:35:37+00:00Added an answer on June 10, 2026 at 2:35 am

    Something like this (starting with CleanRecord which you defined in your question):

    dim matchingRow = CleanRecord.First()
    
    dim props = matchingRow.GetType().GetProperties( _
                    BindingFlags.Instance or BindingFlags.Public))
    
    dim myReturnVal = (from prop in props _
                       where prop.Name = "day2" _
                       select prop.GetValue(matchingRow, Nothing).FirstOrDefault()
    
    return myReturnVal
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that I need to update where all columns are optionally
I have written PLSQL program that generates table having usually more than 200 columns.
I have a score table that contains two columns: user_id and score user_id    score 1               200
I have table that I insert data with following query (from c# code): INSERT
I have a table that stores data that has been entered regarding the amount
I have a table in my warehouse that has columns in all uppercase. It
I have table named 'Dictionary' with columns as follow: ID bigint TYPE varchar (200)
I've got an inventory table that needs to have certain in each row, and
I have a database table called users This table has two columns (that are
I have a table in PostgreSQL that I need read into memory. It is

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.