DateTime problem

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
 
M

Morten Wennevik

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.
 
T

Tigger

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top