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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:11:35+00:00 2026-06-06T11:11:35+00:00

DataRow contains a Table property, which seems to return the entire Table for which

  • 0

DataRow contains a Table property, which seems to return the entire Table for which this row belongs.

I’d like to know if I can use that table safely, or if there are gotcha’s.
In http://msdn.microsoft.com/en-us/library/system.data.datarow.table.aspx documentation, it says “A DataRow does not necessarily belong to any table’s collection of rows. This behavior occurs when the DataRow has been created but not added to the DataRowCollection.”, but I know for a fact my row belongs to a table.

In terms of pointers, if each Row from DataTable points to original DataTable, than I’m good to go. Is that all ‘Table’ property does?

Just to explain why I’m trying to get entire Table based on a single DataRow:
I’m using linq to join two (sometimes more) tables. I’d like to have a generic routine which takes the output of linq (var), and generate a single DataTable with all results.
I had opened another question at stackoverflow (Join in LINQ that avoids explicitly naming properties in "new {}"?), but so far there doesn’t seem to be a generic solution, so I’m trying to write one.

  • 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-06T11:11:36+00:00Added an answer on June 6, 2026 at 11:11 am

    if you know the row is part of table than yes you can access it without any problem. if the possibility exists where the row may not be associated to a table than check if the property is null.

    if(row.Table == null)
    {
    }
    else
    {
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some C# code that looks something like this System.Data.DataRow row; var table
I want to do something like this: private User PopulateUsersList(DataRow row) { Users user
I have a datasource which contains dated items per row. These will be bound
How can i solve this error:Column 'ASSET' does not belong to table . ?
I would like to have a dictionary object contains string keys and values, which
For Each row As DataRow In dgrFarms.Rows Dim sendtroopid As Integer sendtroopid = row(idColumn)
I have a row collection (DataRow[] rows). And I want to import all rows
I have an array of DataRow objects in my C# project which I would
if add row to DataTable DataRow row = datatable1.NewRow(); row[column2]=column2; row[column6]=column6; datatable1.Rows.Add(row); How about
i am trying to write a function that will make DataRow[column] return nullable typed

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.