WinForm------字段不能为空错误

错误信息:

“System.Data.ConstraintException”类型的异常在 EntityFramework.dll 中发生,但未在用户代码中进行处理
其他信息: The 'AutoDeliver' property on 'Material' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Boolean'.

 

解决方法:

在Model实体类中的属性添加"?"

public bool? AutoDeliver { get; set; }

 

posted @ 2016-10-24 10:01  玉天恒  阅读(354)  评论(0)    收藏  举报