Tag Archives: Nullable DateTime C#

Reading null values from datatabase in C# code

If you tried reading a null value from the database such as a null date, you might have across this exception Specified cast is not valid Casting Nullable Values The following code works unless a null datetime is returned. Note … Continue reading

Posted in Troubeleshoot | Tagged , , , , | Leave a comment

DateTime with Null values

In C#, if you declare a DateTime type variable, it can only accept a valid date, time value. If they are invalid dates, it will not accept it. But what about if a date is simply null? Well it it … Continue reading

Posted in Uncategorized | Tagged | 1 Comment