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

后端 未结 23 1390
旧时难觅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:04

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

    This error occurred when due to NOT assigning any value against a NOT NULL date column in SQL DB using EF and was resolved by assigning the same.

    Hope this helps!

提交回复
热议问题