问题在于三元运作.您正在将数据类型从DateTime更改为可为空的DateTime.三元操作要求您在冒号之前和之后返回相同的数据类型.做这样的事情会起作用:
someDateTimeControl.Value = (tempDate > DateTime.MinValue) ? (DateTime?)tempDate : null;