一、忘记对应表
错误提示:
发生了 System.Data.Entity.Core.EntityCommandExecutionException
Message=An error occurred while executing the command definition. See the inner exception for details.SQLiteException: SQL logic error or missing database
no such table: Employees
解决方法:
1.实体类引用 using System.ComponentModel.DataAnnotations.Schema;
并在类名上添加[Table("Employee")]
二、字段名对应错误
错误提示:
The member with identity ' ' does not exist in the metadata collection.\r\nParameter name: identity
显示字段数据时正常,更新时出错误。
解决方法:
仔细对照一下实体类 与 数据库表的名称是否一致