469,934 Members | 2,754 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Unique values from column in DataTable (source = xml)

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 (column name would be 'project'
and will at max contain 30 different projects). What would be the best
way to do this? Using a RowFilter and then pass the results into an
array if possible? I'm a bit stuck on how to do this the best way.

Thanks in advance,
Frederik

May 1 '06 #1
1 1915
Fred,

The best way to do this would be to enumerate through all of the rows in
the table, and then get the unique values yourself. The DataTable/DataView
doesn't have anything really which helps in this regards.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Fred" <fr********@gmail.com> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
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 (column name would be 'project'
and will at max contain 30 different projects). What would be the best
way to do this? Using a RowFilter and then pass the results into an
array if possible? I'm a bit stuck on how to do this the best way.

Thanks in advance,
Frederik

May 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Agoston Bejo | last post: by
5 posts views Thread by Marie | last post: by
13 posts views Thread by scorpion53061 | last post: by
3 posts views Thread by chris | last post: by
3 posts views Thread by Bruce Wood | last post: by
9 posts views Thread by =?Utf-8?B?UGV0ZXJX?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.