getting count grouped datatable vb around linq
i'm controlling mental roadblock here i'm anticipating i'm blank something obvious.
anyway, assume i have list looks this:
id lookupvalue sortorder
============================================
1 1000
2 b 2000
3 b 2000
4 c 3000
5 c 4000
i'm perplexing find, controlling linq, places where lookupvalue
same, nonetheless arrange method opposite (the id
pk database list irrelevant exercise).
i guess easiest proceed organisation lookupvalue
sortorder
following places where lookupvalue
appears some-more twice result.
right now, formula grouped list looks this:
dim keysortpairs = d mydatatable _
organisation pivotal = d(lookupvalue).tostring(), sortorder = d(sortorder).tostring() _
organisation _
name key, sortorder
looking debug output, above formula produces outcome (which correct):
key sortorder
================
a 1000
b 2000
c 3000
c 4000
to register key
's then, i'm looking by law this:
for any opening keysortpairs.where(function(t) t.key.count() > 1)
'multiple arrange orders!!'
next
in code, however, every opening grouped outcome gets returned. am i blank something, shouldn't count wholly give me entries where key
appears some-more once? i assume i'm origination excusable mistake due low-level comfort vb.net, nonetheless i can't figure out -- i've attempted relocating count()
where
apportionment linq expression, nonetheless gave me same thing.
Comments
Post a Comment