Sunday, 15 July 2012

linq - Using order by round -



linq - Using order by round -

here's problem, have inherited database driven app written in asp.net...

at moment has line

var ovs = (from in data.ads_tests orderby i.samplenumber descending select i).take(numtofetch);

i new this, beingness php, , sql background..

how write round function there, illustration in sql write

order round(samplenumber, 0) desc, samplenumber

most query providers typically back upwards utilize mutual static methods. assuming linq sql, supports utilize of math.round().

var ovs = (from in data.ads_tests // overload of round() supported needs rounding mode orderby math.round(i.samplenumber, midpointrounding.awayfromzero) descending, i.samplenumber select i).take(numtofetch);

linq

No comments:

Post a Comment