Nick
Wed Dec 03 04:06:13 CST 2003
Yep - that will do. This is still just another mutually agreed upon date
that is read as null while still being a valid date. Probably a better
choice that 1 Jan 1900.
Nick
"Robert Jacobson" <rjacobson_at_oddpost_com@nospam.com> wrote in message
news:e367QmWuDHA.4060@TK2MSFTNGP11.phx.gbl...
> What about just using the default value ("00:00:00.0000000, January 1,
> 0001", or 0 ticks) as the "special" type? It seems a bit more
> understandable then using a special "magic number" for the value.
>
> Dim dt as DateTime
> ...
>
> If dt.Ticks() = 0 then
> ... (it's not initialized)
> Else
> ' Reset dt to zero (default value)
> dt = New System.DateTime
> End If
>
> (Air code.)
>
>
> "Nick Wienholt" <goyousharks@hotmail.com> wrote in message
> news:00cd01c3b95c$ab8cd850$a001280a@phx.gbl...
> > > The main
> > >problem is that if you set the date to Nothing it is not
> > >Nothing.
> >
> > System.DateTime is a value type, so it can't be set to
> > nothing.
> >
> > > Does anyone have a good solution for testing if
> > >a date parameter to a Sub is Nothing?
> > >
> >
> > There are a couple of options:
> >
> > 1. Use the nullable types in System.Data.SqlTypes.
> > 2. Use a third-party library like Nullable Types. (I
> > think this project lives on CodeProject).
> > 3. Use a "special" DateTime like 1 Jan 1900 to signify
> > nullability.
> >
> >
> > Nick Wienholt, MVP
> > Maximizing .NET Performance
> >
http://www.apress.com/book/bookDisplay.html?bID=217
> > Sydney Deep .NET User Group www.sdnug.org
> >
>
>