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!


2 comments:

Anonymous said...

Thanks

Anonymous said...

Somebody necessarily assist to make severely posts I'd state.
This is the first time I frequented your website page and up to now?
I surprised with the analysis you made to create this particular put up incredible.
Fantastic job!

Powered By Blogger · Designed By Seo Blogger Templates