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

后端 未结 23 1335
旧时难觅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 20:39

    If you ahve access to the DB, you can change the DB column type from datetime to datetime2(7) it will still send a datetime object and it will be saved

提交回复
热议问题