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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:48:18+00:00 2026-05-23T04:48:18+00:00

In a DataTable : I can access all of the DataRow elements like so:

  • 0

In a DataTable:

I can access all of the DataRow elements like so:

DataTable table = GetMyTable();
for (int i = 0; i < table.Rows.Count; i++) {
  DataRow row = table.Rows[i];
  Console.WriteLine(row);
}

Also, I can access all of the DataColumn elements like this:

DataTable table = GetMyTable();
for (int i = 0; i < table.Columns.Count; i++) {
  DataColumn column = table.Columns[i];
  Console.WriteLine(column);
}

Finally, I can access each individual Cell of the DataTable object like this:

DataTable table = GetMyTable();
for (int i = 0; i < table.Rows.Count; i++) {
  DataRow row = table.Rows[i];
  object[] array = row.ItemArray;
  for (int j = 0; j < array.Length; j++) {
    object cell = array[j];
    Console.WriteLine(cell);
  }
}

At least it looks like some information is lost in the third technique.

Here’s my question:
How is this array of objects being managed?

I’ve been playing with how to recreate something with this basic type of functionality (since I am already familiar with it), but I just don’t know how to design all these little sub-classes to make it work!

  • 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-23T04:48:19+00:00Added an answer on May 23, 2026 at 4:48 am

    The table has a list of DataColumn. This is a list of column definitions. The table has a list of rows. Each row has one cell for each column in the list of columns.


    The trick is that the rows are created by the table. The table knows the length of the Columns collection, as well as the data types of the columns and any constraints on them. When the table creates a DataRow, it creates it with the correct number of columns.

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

Sidebar

Related Questions

How can i compare two rows of datatable in QTP
Can an Ajax-enabled WCF Service pass back a DataTable as a Sys.Data.DataTable? Like this
How can I load a CSV file into a System.Data.DataTable , creating the datatable
How can we copy one datacolumn with data from one datatable to another datatable
How can I create the JSON source expected by the google.visualization.datatable using C#? Obviously
I currently use a DataTable to get results from a database which I can
When Binding a GridView to a DataTable, How can we Change the value displayed
In a .NET Datatable, the columns are Object types, which can include a datatable
If I have an ObjectDataSource defined at design time, can I get a DataTable
When using IDbCommand, IDataReader, or DataTable, can you depend on the destructor to dispose

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.