var dict = new Dictionary<string, object>();
DateTime? myDate;
/*Next line gives: Type of conditional expression cannot be
determined because there is no implicit conversion between 'System.DateTime?'
and 'System.DBNull' */
dict.Add("breakit", myDate.HasValue ? myDate.Value : DBNull.Value);
I don’t understand why there needs to be an implicit conversion if one or the other is going into a dictionary expecting type Object.
In C#, every conditional expression must have a type. What type is your expression of?
I understand your concern, the conversion is not needed for your particular case, but this is how C# compiler works, so you have to obey its rules.
This should work instead (I didn’t check though):