So I have created a System.Nullable
Datetime? emailDate;
And a typed DataRow from my DataTable:
MyDataSet.FactRow factRow = factTable.Rows[0];
Why does this NOT WORK:
emailDate = factRow.IsEmailDateNull() ? null : factRow.EmailDate;
But this works:
if (factRow.IsEmailDateNull())
emailDate = null;
else
emailDate = factRow.EmailDate;
Compiler error is: Type of conditional expression cannot be determined because there is no implicit conversion between '
Update:
David defined this problem as a feature. But aren't both examples the same? Isn't this just a compile thing to convert from the first example to the second one?
I think it has to do something with nullable types, because with string or byte[] it works like a charm:
byte[] picture = factRow.IsPictureNull() ? null : factRow.Picutre;