DateTime problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

in a huge project i have the following problem.

I create an object which contains many public members (i know that this is
not correct, but it is a single use migration program). The members will be
filled from database tables. In the fill method i see in debug mode the
correct values. At the source where i create the object the DateTime members
of the object are not present (error: cannot obtain value). An statement like
this
DateTime dat = object.startDate delivers 01/01/01.
If the object reference will be pass to a other method, in this method is
the correct DateTime value present.
This all happens only for the DateTime members. Int32, String, .. are not
affected.

Who can help?

Josef Fieseler
 
Hi Josef,

Try to avoid multi-posting, please. Stick to a single news group and post
in others if noone replies within reasonable time (24 hours).

See my reply in the General group.
 
DateTime is a value type which means it cannot be null.

It defaults to 1/1/1 so you should treat this as its null equivalent.


Tony
 
Back
Top