Null Dates

C

Craig Buchanan

I have a custom class that has a property defined as a Date. If the
property is not set in the UI, the property's value is "12:00:00AM".

This cause problems when I try to insert or update this data in SQL Server
2000, via a stored procedure. SQL indicates that it isn't a valid date
(rightly so).

As a solution, I've changed the property to be an Object.

What I really need is a Null Date. Is there a more elegant solution?

Thanks,

Craig Buchanan
 
M

mikeb

Craig said:
I have a custom class that has a property defined as a Date. If the
property is not set in the UI, the property's value is "12:00:00AM".

This cause problems when I try to insert or update this data in SQL Server
2000, via a stored procedure. SQL indicates that it isn't a valid date
(rightly so).

As a solution, I've changed the property to be an Object.

What I really need is a Null Date. Is there a more elegant solution?

Thanks,

Craig Buchanan

System.Data.SqlTypes.SqlDateTime
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top