Unique values from column in DataTable (source = xml)

F

Fred

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top