Use DateTime?
What is your problem in particular?
- Change
Itβs just so clear that the object is a Nullable DateTime, not a question :)
DateTime? t = null;
- Change
When replying to a comment, check it like this:
DateTime? theTime; if( table["TheColumn"] == DBNull.Value ){ theTime = null; } else { theTime = (DateTime) table["TheColumn"]; }
Noon silk
source share