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

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

    I think the most logical answer in this regard is to set the system clock to the relevant feature.

     [HttpPost]
            public ActionResult Yeni(tblKategori kategori)
            {
                kategori.CREATEDDATE = DateTime.Now;
                var ctx = new MvcDbStokEntities();
                ctx.tblKategori.Add(kategori);
                ctx.SaveChanges();
                return RedirectToAction("Index");//listele sayfasına yönlendir.
            }
    

提交回复
热议问题