The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value

后端 未结 23 1427
旧时难觅i
旧时难觅i 2020-11-28 20:19

I have the following code in my HomeController:

public ActionResult Edit(int id)
{
    var ArticleToEdit = (from m in _db.ArticleSet where m.storyId == id se         


        
23条回答
  •  天命终不由人
    2020-11-28 21:05

    If you have a column that is datetime and allows null you will get this error. I recommend setting a value to pass to the object before .SaveChanges();

提交回复
热议问题