【发布时间】:2012-06-17 22:01:14
【问题描述】:
我使用这个属性在我的数据库中创建了一个列:
public int EnteredDateTime { get; set; }
但是,当我更新属性时,该列已正确创建:
public DateTime EnteredDateTime { get; set; }
我收到以下错误:
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
我做错了什么?
【问题讨论】:
-
您是否使用 CodeFirst 生成数据库?
-
在哪里你得到错误?
-
是的,我已经使用了Code First,如何在属性中设置默认值?
标签: c# entity-framework orm migration entity