I am trying to insert a null (DateTime) value into my database for the field typed by 'date', but I always get '0001-01-01'. I do not understand this field is "allow nulls" and I do not know why I have this default value.
I am using C # asp.net with MVC (Entity Framework), this is my code:
Budget_Synthesis newBS = new Budget_Synthesis { Budget_Code = newBudgetCode, Last_Modified_Date = null }; db.Budget_Synthesis.AddObject(newBS);
Last_Modified_Date introduced by System.DateTime? therefore, I donโt know why they change this โzeroโ.
If I try to display the value in my application, I get 01/01/0001 00:00:00
And 0001-01-01 with SSMS
Can someone explain to me why I can't get the real "NULL"?
Best wishes
Alex
source share