I am trying to check a condition before assigning a value to a date field. If there is no value then I want to set it to null. The problem is when I attempt to do this I get the following error:
Error 9 Type of conditional expression cannot be determined because there is no implicit conversion
This is the same as this: e.DOB = (txtDOBIntake.Text.Length > 0) ? DateTime.Parse(txtDOBIntake.Text) : null;
Which seams to work on some data types (i.e. int) but not on a Date field. With a date it throws this: Error 9 Type of conditional expression cannot be determined because there is no implicit conversion