How to manage GetDate() with Entity Framework

前端 未结 5 1240
一生所求
一生所求 2021-02-07 03:52

I have a column like this in 1 of my database tables

DateCreated, datetime, default(GetDate()), not null

I am trying to use the Entity Framewor

5条回答
  •  我在风中等你
    2021-02-07 04:33

    Changing type of DateCreated to datetime2 might solve the problem.

    datetime 2007-05-08 12:35:29.123

    datetime2 2007-05-08 12:35:29. 12345

    Ref: http://technet.microsoft.com/en-us/library/bb677335.aspx67

提交回复
热议问题