Passed null date coming across as #12:00:00 AM#

  • Thread starter Thread starter Ronald S. Cook
  • Start date Start date
R

Ronald S. Cook

When I pass a null date from my client to my service project, it comes
across as #12:00:00 AM#. While I can easily code for this, it seems like a
hack. Is this normal?

I'm using WCF, by the way.

Thanks,
Ron
 
When I pass a null date from my client to my service project, it comes
across as #12:00:00 AM#. While I can easily code for this, it seems like a
hack. Is this normal?

I'm using WCF, by the way.

Thanks,
Ron

DateTime is a structure so it is impossible to assign null for it. In
order to specify the null date it is often assigned to
DateTime.MinValue. Maybe this has happened in your case.

Regards,
Mykola
http://marss.co.ua
 
DateTime is a structure so it is impossible to assign null for it. In
order to specify the null date it is often assigned to
DateTime.MinValue. Maybe this has happened in your case.

An alternative, if it's supported by WCF, would be to use DateTime?
(i.e. Nullable<DateTime>).

Jon
 

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

Back
Top