c# - avoid duplicate values in datatable -


in db have values true/false/false/true.... need distinct values true , false , not values true & false & false & true...

my code:

 datatable dv= dt.defaultview.totable(true, col.header);  dv.casesensitive=true; 

but got values true & false & false.

how avoid both similar values if caps / small letters , true & false values.

it should done @ backend. in c# not through query......

with linq can this:

var s = (from p in dv              orderby p.yourcolumn              select p.yourcolumn.toupper()).distinct(); 

here blog post you.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -