I suggest you just return a DateTime?
and let the caller do the defaulting:
public static DateTime? SafeGetDateTime(this OracleDataReader reader, int colIndex)
{
return reader.IsDBNull(colIndex) ? null
: (DateTime?) reader.GetDateTime(colIndex);
}
Now you can use:
DateTime fromReaderOrNow = reader.SafeGetDateTime(1) ?? DateTime.Now;
And if you need the control part:
DateTime? fromReader = reader.SafeGetDateTime(1);
if (fromReader == null)
{
control.Checked = false;
}
DateTime fromReaderOrNow = fromReader ?? DateTime.Now;
If you really need to do that in multiple places, you can wrap up a method to do - and you won't be repeating the SafeGetDateTime
code.
(I would encourage you to separate our your database code further from your UI code to start with, to be honest.)