How to get rid of 'property could not be set to a double value, you must set this property to a non-null value of type decimal'

南笙酒味 提交于 2019-12-05 19:22:40

You need to define it like this: public decimal Cnt

Found the issue. My stored procedure was missing a cast on Cnt after a rounding operation.

Milon

I think this field is float type in your database table. so you need to set it double? if this field is nullable or otherwise use double

public double? field_name {get; set}
// or 
public double field_name {get; set}

It's working for me

I had this problem and my issue was that on the DB, the type was real and in the EF class was declared as decimal. I just changed the DB type to real and problem solved.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!