日期:2014-05-20  浏览次数:20818 次

LINQ to Entities 不识别方法“Double Sqrt(Double)”,因此该方法无法转换为存储

double x=50;
var items=from t in CityAction where Math.Sqrt(t.CoorX)<=x select t;


报错:LINQ to Entities 不识别方法“Double Sqrt(Double)”,因此该方法无法转换为存储.

Math.Sqrt(t.CoorX)这个地方求平方根的时候报错,有什么办法可以解决?
LINQ?to?Entities Linq

------解决方案--------------------
double x=50;
var items=from t in CityAction.ToList() where Math.Sqrt(t.CoorX)<=x select t;