Link to home
Start Free TrialLog in
Avatar of rawcoder
rawcoder

asked on

LINQ DateTime save is not working when field need to be null

I am currently trying to save a record to a sql server express database.  One of the fields is a DateTime field that needs to be null upon record creation.  For some reason, even though the linq object that represents the data has a null value set for the record, I keep getting a SqlDateTime error indicating that the date enter should be between 1753 and ......., forgot the max range.  Anyway, if I am setting this field as null why is this occuring and what can I do to fix it(workarounds)?
Avatar of wdosanjos
wdosanjos
Flag of United States of America image

For the field to accept null values it should be defined as DateTime? not DateTime.
ASKER CERTIFIED SOLUTION
Avatar of guramrit
guramrit
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial