Wednesday, August 3, 2011

For translation to SQL, the Math.Round method needs a MidpointRounding parameter. Use 'AwayFromZero' to specify the SQL function ROUND.



Whenever you will try to use Math.Round with LINQ, that time you will face this error:

For translation to SQL, the Math.Round method needs a MidpointRounding parameter. Use 'AwayFromZero' to specify the SQL function ROUND.


To overcome this problem. just do as its saying..
avgRate = Math.Round( (double) rmpd.Average(a => a.reate),1, MidpointRounding.AwayFromZero )

Compiled By: Rajesh Rolen

Share This!


1 comment:

Anonymous said...

Thanks

Powered By Blogger · Designed By Seo Blogger Templates