Null Dates

  • Thread starter Thread starter Craig Buchanan
  • Start date Start date
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
 
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
 
Back
Top