F
Fred Nelson
Hi:
Another C# newby question:
How do I declare a null DateTime variable:
DateTime myDate = null;
I get the error:
"Cannot convert null to 'System.DateTime' because it is a value type"
(If I don't set a date then the value defaults to "1/1/0001")
I'm converting a VB.NET app to C# and I was able to declare null dates in
that language. Is there another Date type that will allow this - if not
then what is the best way to handle this - should I keep checking for 1/1/1
and consider that to be "null".
Thanks for your help!
Fred
Another C# newby question:
How do I declare a null DateTime variable:
DateTime myDate = null;
I get the error:
"Cannot convert null to 'System.DateTime' because it is a value type"
(If I don't set a date then the value defaults to "1/1/0001")
I'm converting a VB.NET app to C# and I was able to declare null dates in
that language. Is there another Date type that will allow this - if not
then what is the best way to handle this - should I keep checking for 1/1/1
and consider that to be "null".
Thanks for your help!
Fred