.Net Nullable - how do you use it?
Posted on 2011-02-28
If you declare a variable (for example) DateTime? myDate, I can't seem to do anything with it unless I explicity cast it back to a DateTime:
DateTime? myDate = objectWhichMayMakeNullOrDateTime.GetVal();
string myString= myDate.ToString("hh:mm"); //fails
What good is the nullable operator here? What is a better way of doing this?