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的更多相关文章

  1. LINQ to Entities 不识别方法“Int32 ToInt32(System.String)”,因此该方法无法转换为存储表达式。

      通常原始代码如下: Where id=Convert.ToInt32(cousid) 更改后代码: Var currentid= Convert.ToInt32(cousid); Wehre id ...

  2. mvc ef LINQ to Entities 不识别方法“Int32 Parse(System.String)”,因此该方法无法转换为存储表达式。

    private sys_User GetUserInfo() { sys_User model = null; var userId = Convert.ToInt32(AccountHelper.G ...

  3. 关于.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 ...

  4. 报错:System.NotSupportedException: LINQ to Entities does not recognize the method

    报错:System.NotSupportedException: LINQ to Entities does not recognize the method ...... get_Item(Int3 ...

  5. 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. ...

  6. 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 ...

  7. 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 ...

  8. 报错: LINQ to Entities 不识别方法“Int32 Parse(System.String)

    断点调试发现报错的语句为: public ActionResult SomeMethod(string someId) { var temp = SomeService.LoadEntities(a ...

  9. LINQ to Entities不支持Convert.ToDateTime方法解決一例

    錯誤提示: LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' met ...

随机推荐

  1. font-face 跨域解决

    nginx 里设置@font-face 跨域 server { ... # Fix @font-face cross-domain restriction in Firefox location ~* ...

  2. c# comboBox输出图文效果

    核心代码:重写DrawItem事件 void Event_CboDrawItem(object sender, DrawItemEventArgs e) { ) return; var cbo = s ...

  3. Ansible 进阶技巧

    原文  http://www.ibm.com/developerworks/cn/linux/1608_lih_ansible/index.html?ca=drs-   简介 Ansible 是一个系 ...

  4. 【C】——利用sigsuspend函数等待信号阻塞进程

    #include<signal.h> int sigsuspend(const sigset_t *sigmask); 返回值:-,并将errno设置为EINTR 将进程的信号屏蔽字设置为 ...

  5. 为什么Java匿名内部类访问的外部局部变量或参数需要被final修饰

    大部分时候,类被定义成一个独立的程序单元.在某些情况下,也会把一个类放在另一个类的内部定义,这个定义在其他类内部的类就被称为内部类,包含内部类的类也被称为外部类. class Outer { priv ...

  6. python爬虫数据-下载图片经典案例

    '''Urllib 模块提供了读取web页面数据的接口,我们可以像读取本地文件一样读取www和ftp上的数据.首先,我们定义了一个getHtml()函数: urllib.urlopen()方法用于打开 ...

  7. (笔记)Linux下的准确延时,#include <linux/delay.h>调用出错

    在编写应用层程序时,有时需要延时一下,这个时候该怎么办呢? 在内核代码中,我们经常会看到这样的头文件使用#include <linux/delay.h>,心想着直接调用这个就可以了吧!可是 ...

  8. 嵌入式开发之hi3519---spi nor flash启动

    author:pkf qq:1327706646 1.官方hi3519默认是硬件3byte 地址模式,配置完ddr始终后,sdkv100.020是可以支持正常启动,用到低位16Mflash内存 2.如 ...

  9. 在Eclipse中设置进行JNI的头文件编译方法(转 http://blog.csdn.net/mirkerson/article/details/17187109)

    这两天在搞NDK开发,JNI的头文件进行编译的时候,要跑到对应的class文件路径下(通常是工程的bin目录),进行编译生成,很是不便,也容易出错,所以考虑在Eclipse中作为外部工具引入,所以便查 ...

  10. Keystone-all 命令

    本文档介绍Icehouse版keystone-all命令 keystone-all命令在一个进程中同时启动服务和管理API,为openstack提供服务目录,授权和身份认证服务. 用法 $ keyst ...