473,387 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Accesing Values in DataTable Column

How can i access all the values in a particular column of a DataTable.
How can i then store these values in an array.
Jul 21 '05 #1
2 5707
Job,

A datatable is a collection of items in a collection (array) of rows

Therefore
datatable.rows(0).item(0) is the first collection item in the first row.

Bringing this to an array is almost forever useless because it is already an
collection.

There is not a one by one inbuild convert function for this, however when
you really want it you can do it using a simple for index loop or a for each
loop depending on the type of array you want to make.

I hope this helps,

Cor
"Job Lot" <Jo****@discussions.microsoft.com>
....
How can i access all the values in a particular column of a DataTable.
How can i then store these values in an array.

Jul 21 '05 #2
Thanks

"Cor Ligthert" wrote:
Job,

A datatable is a collection of items in a collection (array) of rows

Therefore
datatable.rows(0).item(0) is the first collection item in the first row.

Bringing this to an array is almost forever useless because it is already an
collection.

There is not a one by one inbuild convert function for this, however when
you really want it you can do it using a simple for index loop or a for each
loop depending on the type of array you want to make.

I hope this helps,

Cor
"Job Lot" <Jo****@discussions.microsoft.com>
....
How can i access all the values in a particular column of a DataTable.
How can i then store these values in an array.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: scorpion53061 | last post by:
Very urgent and I am very close but need a little help to get me over the edge........ I need to write these columns to a html file with each row containing these columns (seperated by breaks)....
2
by: Job Lot | last post by:
How can i access all the values in a particular column of a DataTable. How can i then store these values in an array.
6
by: Marcel Hug | last post by:
Hi all ! I have a table in my database, which has 3 attributes. IDFailureControl, ControlDate and ControlVersion. In the following function I test, if the date of today allready exists. Then I...
1
by: Fred | last post by:
Hi all, I have a DataTable that is being filled with data from an xml file. Now I need to get an array of strings from that DataTable that returns all the unique values in a certain column...
9
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have a TabControl on a Windows form in which I have various tab pages each with a DataGridView, the first column of which is a DataGridViewCheckBoxColumn and subsequent columns being...
4
by: Massimo | last post by:
Hi to All, i'm using C# in .NET 2.0 and i have a DataTable A with a column of type TimeSpan used to store HOUR info. I'm trying to filter my DataTable A selecting only rows that have the column...
4
by: Bobby Edward | last post by:
I have an xsd dataset. I created a simple query called GetDataByUserId. I can preview the data fine! I created a very simple BLL function that calls it and returns a datatable. When I run...
1
rizwan6feb
by: rizwan6feb | last post by:
I have a DataTable with thousands of records, i want to show these records on per page basis ( i.e a DataGridView showing first 20 records and next button to show next 20 records ...) To achieve...
2
by: anatanat | last post by:
hello :) I want to bind a combobox to a specific column in a DataTable. I want the combobox items to display distinct values. I tried: combo.datasource = dataTable; combo.DisplayMember =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.