解决方法:

[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. unity模型任意无限切割插件

    概述 3d模型的任意切割一直是游戏开发里的一个很大的问题,模型切割的关键点就只有生成横切面的新顶点以及切口纹理的缝合,理论上解决了这两点,就近乎可以做到以假乱真的程度了.本篇文章就这两点进行描述 详细 ...

  2. Android API之android.view.View.MeasureSpec

    android.view.View.MeasureSpec MeasureSpec是View的内部类 public static class MeasureSpec MeasureSpec封装从par ...

  3. sqlconnection 调用webservice服务

    package cn.itcast.service.urlconnection; import java.io.InputStream; import java.io.OutputStream; im ...

  4. 利用Oracle 发送邮件(utl_smtp)

    发送邮件的方法有很多,.NET前台也可以通过创建邮件类的形式, 通过微软提供的System.Net.Mail.dll 也可以简单的发送邮件.但是代码比较长,操作起来虽然很简单(很多细节忽略了). 这里 ...

  5. laravel-v5.1数据库连接文件是.env文件

  6. Linux命令-文件处理命令:ln

    ln -s /etc/issue /tmp/issue.soft 为这个/etc/issue文件创建一个软连接,名称为/tmp/issue.soft(相当于windows里面给/etc/issue文件 ...

  7. 输出流格式化(以操纵子方式格式化,以ios类成员函数方式格式化)

    一.以操纵子方式格式化 数据输入输出的格式控制使用系统头文件<iomanip>中提供的操纵符.把它们作为插入操作符<<的输出对象即可.如setiosflags.setw.set ...

  8. HDU 3746 数据结构之KMP

    pid=3746">点击打开链接 题意:给T组数据,每组一个字符串,问最少加入多少个字符能够使这个串变成一个子串连续出现的串 思路:利用KMP的next数组进行变换,next数组保存的 ...

  9. highcharts图表史上最全的参数配置(属性+事件)

    今天这里将给大家全全展现相关的参数配置: chart.events.addSeries:添加数列到图表中. chart.events.click:整个图表的绘图区上所发生的点击事件. chart.ev ...

  10. SMBus总线概述

    1.概述: 系统管理总线是一种两线制接口.它基于I2C 总线原理演变而来,可以认为是简化版的I2C总线. SMBus最初是应用到智能电池,如电池充电器和一个微控制器.其提供一个系统和电源管理相关的任务 ...