Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

How to select few columns and distinct values from a datatable

$
0
0

Dear reader

How to select few columns and distinct values from a datatable....?

I have a large datatable and just want to assign a view columns of it to a datagridview and need a distinct selection on one of the columns....

I tried dozens of examples i can find here but none of them worked really when converted to my needs....  which is due my nooby-ism i guess... i know how to programm work arounds but that will ask a lot of code where the answer should be much easier in my believe.... so anyone advanced plz help..

For example

I have a filled datatable dtFilled with lets say 10 columns, called col1, col2 .... col10

And col10 has values like "Hoi", "hello", "ola", "sainbanuu"  (which is Mongolian :o) which assume has only this 4 distinct values

So how to get col9 and col10 into a datagridview (maybe with help of an additional datatable) where all distinct values from col10 are listed

For example

col9      col10

value    hello

value    Hoi

value    ola

value    sainbanuu


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>