* "Andre Beier" <An*********@gmx.net> scripsit:
I have a date variable that initially contains any date. However, depending
on user actions I want to set the value of the date var to Nothing.
I tried the following:
myDate = Nothing --- deletes the date but I always have 12:00:00 AM in
there
myDate = "" --- compiler error
myDate = 0 ---- compiler error
You cannot, because 'DateTime' is a value type and value types are not
"nullable". You may want to use the 'SqlDateTime' datatype, writte a
wrapper class around 'DateTime' which has, for example, an 'IsNothing'
property, or wait for .NET 2.0 which allows nullable value types by use
of generics.
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>