解决方法:

[Table("bma_products")]
public class Product
{
  //加上[Key]即可
  [Key]
  public int pid{get; set;}
  public string psn{get; set;}
}

Linq------错误:EntityType: EntitySet 'Products' is based on type 'Product' that has no keys defined.的更多相关文章

  1. 出现错误日志:The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

      tomcat6出现错误日志: 信息: The APR based Apache Tomcat Native library which allows optimal performance in  ...

  2. Newtonsoft.Json转换强类型DataTable错误:Self referencing loop detected with type ......

    问题,在使用Newtonsoft.Json对强类型的DataTable进行系列化时会出现循环引用错误 解决办法,不要直接系列化强类型的DataTable,改为 JsonConvert.Serializ ...

  3. linux开机出现一下错误Give root password for maintenance (or type Control-D to continue):

    由于错误的编辑/etc/fstab文件 而引起的不能正常进入系统.假如你将某一个分区或者磁盘最后一个参数设置为1或2时,系统默认会在开机过程中检查这个磁盘的扇区.假如系统检查不到这个磁盘,或者这个磁盘 ...

  4. Python2 错误记录1File "<string>", line 1, in <module> NameError: name 'f' is not defined

    Python 2下 count = 0 while count < 3: user = input('>>>') pwd = input('>>>') if ...

  5. android编译错误“OnClickListener cannot be resolved to a type”

    在android代码编译时可能会出现如下错误: 部分代码: <span style="font-size:18px;">public void onCreate(Bun ...

  6. Spring3.x错误----Bean named "txAdvice" must be of type[org.aopallibance.aop.Advice

    Spring3.x错误: 解决方法: aopalliance-1.0.jar 和 aopalliance-alpha1.jar之间的冲突.

  7. Spring Cloud ZooKeeper集成Feign的坑1,错误:Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.

    错误如下: ERROR 31473 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** A ...

  8. c++编译错误:invalid new-expression of abstract class type

    原因: 出现这个错误原因是new 了一个抽象类出错,说明父类(接口)中有纯虚函数没有实现.接口里的纯虚函数全部需要实现,这样才能new 子类. 例如: 纯虚函数例如 ; 是纯虚函数,不是纯虚函数不作要 ...

  9. IE浏览器报400错误:Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

    前言: 在用IE浏览器时访问tomcat项目时,页面报400错误,后台错误: java.lang.IllegalArgumentException: Invalid character found i ...

随机推荐

  1. SuperMap iServer 9D HBase使用

    需提前将HBase进行部署,参考上篇部署文档 https://www.cnblogs.com/zhangyongli2011/p/9982143.html (转发请注明出处:http://www.cn ...

  2. Docker配置本地镜像与容器的存储位置

    默认情况下Docker的存放位置为:/var/lib/docker 可以通过下面命令查看具体位置: sudo docker info | grep "Docker Root Dir" ...

  3. javascript 异常基本语法

    http://www.w3school.com.cn/js/js_onerror.asp try...catch 的作用是测试代码中的错误.   JavaScript - 捕获错误 当我们在网上冲浪时 ...

  4. Oracle相关操作示例(导出导入dmp需要采用)

    删除用户:drop user pnxd cascade; 导出数据:exp pnxd/padmin@A file=c:\bb.dmp full=y 导入数据:imp pnxd/padmin@PNXD ...

  5. ORM,ORM的原理及测试案例

      提纲 一.什么是ORM.二.反射以及Attribute在ORM中的应用.三.创建一个数据库表和表对应的实体model.四.实体model如何映射出数据库表.五.组合ORM映射生成insert语句. ...

  6. 用ASP.NET/C#连接Access和SQL Server数据库

    连接Access 首先看一个例子代码片断:程序代码: ------------------------------------------------------------------------- ...

  7. 用户 'NT AUTHORITY\IUSR' 登录失败

    今天在用VS20012发布XAF ASP.NET的程序时,在iis 调用SQLSERVER Express2008数据库时,总是出现错误“用户 'NT AUTHORITY\IUSR' 登录失败”,后来 ...

  8. 安卓编译报错:Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

    今天在编译别人的project时遇到了这个错误,心想应该不是代码的问题.网上搜了一下,应该是sdk版本设置的问题,要设置为最新sdk版本才可以. 解决办法就是修改project.properties里 ...

  9. 记一次解决layui 的bug - layer.open 与 layui渲染问题

    场景是这样的,通过layer打开一个弹窗,里面放置一个表单,表单是用layui来渲染的. 当弹窗完成之后,我需要渲染表单中的一些内容.譬如laydate. layer.open({ type: 1, ...

  10. PhotoView

    PhotoView 介绍 追求美是人的天性 PhotoView.js 灵感来自于picasa 本功能是为了解决运营对后台管理系统中用户上传的各种角度和尺寸的图片难以浏览的问题,于是花了两天时间写了这个 ...