The conversion of a datetime2 data type to a datetime data type Error

后端 未结 9 1523
慢半拍i
慢半拍i 2020-12-30 08:45

I have a controller:

[HttpPost]
public ActionResult Create(Auction auction)
{
    var db = new EbuyDataContext();
    db.Auctions.Add(auction);
    db.SaveCh         


        
9条回答
  •  囚心锁ツ
    2020-12-30 08:52

    I had a default getdate() value on DateCreated in the DB. I wasn't setting the value in EF because I didn't think I needed to. Once I passed in the value through EF on the insert then the error went away. Why is that error there in the first place? I never figured that out.

提交回复
热议问题