LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression
if (!string.IsNullOrEmpty(FarmWorkId))
{
data = data.Where(p => p.TypeId == Convert.ToInt32(FarmWorkId));
}
解决方法:
if (!string.IsNullOrEmpty(FarmWorkId))
{
int i = Convert.ToInt32(FarmWorkId);
data = data.Where(p => p.TypeId == i);
}
LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression的更多相关文章
- LINQ to Entities 不识别方法“Int32 ToInt32(System.String)”,因此该方法无法转换为存储表达式。
通常原始代码如下: Where id=Convert.ToInt32(cousid) 更改后代码: Var currentid= Convert.ToInt32(cousid); Wehre id ...
- mvc ef LINQ to Entities 不识别方法“Int32 Parse(System.String)”,因此该方法无法转换为存储表达式。
private sys_User GetUserInfo() { sys_User model = null; var userId = Convert.ToInt32(AccountHelper.G ...
- 关于.ToList(): LINQ to Entities does not recognize the method ‘xxx’ method, and this method cannot be translated into a store expression.
LINQ to Entities works by translating LINQ queries to SQL queries, then executing the resulting quer ...
- 报错:System.NotSupportedException: LINQ to Entities does not recognize the method
报错:System.NotSupportedException: LINQ to Entities does not recognize the method ...... get_Item(Int3 ...
- LINQ to Entities does not recognize the method , and this method cannot be translated into a store expression 解决办法
根据用户输入的起始日期,查询以起始日期开始的前20条记录,在ASP.NET MVC的Controller代码中这样写: var Logs = db.Log.Take(20); if (!string. ...
- LINQ to Entities does not recognize the method 'System.DateTime AddDays(Double)' method, and this method cannot be translated into a store expression.
NormalSubmission=analysis.Count(x=>x.FinishTime<= endTime.AddDays(1))报错linq不能识别 => var endT ...
- LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' method
System.Data.Objects.EntityFunctions和System.Data.Objects.SqlClient.SqlFunctions中的方法进行比较,如下 where Syst ...
- 报错: LINQ to Entities 不识别方法“Int32 Parse(System.String)
断点调试发现报错的语句为: public ActionResult SomeMethod(string someId) { var temp = SomeService.LoadEntities(a ...
- LINQ to Entities不支持Convert.ToDateTime方法解決一例
錯誤提示: LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' met ...
随机推荐
- IDEA 中 同一个微服务 按照多个端口启动
网上讲这个东西的很多,抄来抄去的,大部分类似,多数没讲明白为什么那么配置. 譬如eureka.client.register-with-eureka和fetch-registry是否要配置,配不配区别 ...
- TiKV 源码解析系列——如何使用 Raft
本系列文章主要面向 TiKV 社区开发者,重点介绍 TiKV 的系统架构,源码结构,流程解析.目的是使得开发者阅读之后,能对 TiKV 项目有一个初步了解,更好的参与进入 TiKV 的开发中. 需要注 ...
- Android studio中出现Couldn't resolve resource @dimen/...
问题出现: Path.isConvex is not supported. Rendering problems .. Couldn't resolve resource @dimen/...等等 资 ...
- Coneroller执行时候的-26374及-26377错误
有时候一些不必要的关联也会引起这个问题, 1.首先看下脚本中有没有使用了自动关联(web_reg_save_param) 2.在Virtual的脚本里查询下web_reg_save_param的参数使 ...
- Q_UNUSED() 方法的使用
Q_UNUSED() 没有实质性的作用,用来避免编译器警告 //比如说 int testFunc(int a, int b, int c, int d) { int e; return a+b+c; ...
- Intel edison 智能硬件开发指南 基于YoctoProject
首先简单的介绍一下edison的板子: edison 芯片 22nm工艺,quark双核SoC,采用atom架构,针对小型智能设备 X86架构 相当于一台“奔腾级电脑” 低功耗,小体积,自带wifi ...
- 【Html】网页获取屏幕宽高
<html> <script> function size(){ document.write( "屏幕分辨率为:"+screen.width+" ...
- Linux命令_用户身份切换
命令 su 格式为:su [ - ] username,后面可以跟 - ,也可以不跟. 普通用户的su命令不加username时,就相当于切换到root用户,反之亦然.当su 命令加上 - 后,会初始 ...
- Mac eclipse 编译、调试c++ 程序
可以先安装个CDT插件: eclipse菜单 -> Help -> Install New Software... -> Work with (Add..) Name:CDT Loc ...
- windows sever2003安装Wamp 2.5不成功——VC 11不支持Windows Server 2003和win XP?
Windows Server 2003 安装Wamp 2.5不成功Wampserver 2.5 will not run on Windows XP 报错信息:C:\wamp\bin\apache\a ...