The property on could not be set to a 'Int16' value.You must set this property to a non-null value of type ‘Int32’.”
在vs2010 EF4中查询数据总是报错:
The property on “XX” could not be set to a 'Int16' value. You must set this property to a non-null value of type ‘Int32’.”
原因及解决方法:实体对中的XX字段在数据库中的数据类型被设成了smallint型了,改成int后问题解决。