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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:16:54+00:00 2026-05-23T05:16:54+00:00

I have a datable with 50 rows and has an ID Column. I am

  • 0

I have a datable with 50 rows and has an ID Column. I am trying to get an array that holds only the IDs like:

string [] IDs = (from row in DataTable.Rows
                select row["ID"].toString()).ToArray();

Is there a way to do this. I always get the error “Could not find he implementation of the query….”

  • 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-23T05:16:55+00:00Added an answer on May 23, 2026 at 5:16 am

    Use the DataTableExtensions.AsEnumerable method by adding a reference to System.Data.DataSetExtensions and a using System.Data; Then you should be able to use the following query:

    var query = from row in datatable.AsEnumerable()
                select row["ID"].ToString();
    string[] ids = query.ToArray();
    

    If you really need an array you can use the last line above or enclose the query in parentheses and call ToArray() as you did originally. I’m generally not a fan of the latter approach.

    In fluent syntax it would be:

    string[] ids = datatable.AsEnumerable()
                            .Select(row => row["ID"].ToString())
                            .ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a datable and like this i have searched a datarow from the
I have the same problem. But the differences is that my empty rows are
I have been trying to create a link in each row of a datable
I have some code that prints out databse values into a repeater control on
Have you managed to get Aptana Studio debugging to work? I tried following this,
I Have a set of choices(options) coming from Database(around 36 records) which I have
I have a datatable: <p:dataTable style=width: 100%; id=dTable var=tt value=#{backingBean.memberList} paginator=true rows=20 selection=#{backingBean.selectedMember} selectionMode=single
In a Dataset I have a datatable. This datable can be divided in a
I use datatable plugin in a website. Normally I have only 1 datatable per
I have craeted code which reads the acc no, rtn, name and amt from

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.