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
Post a Comment