Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Null Dates

Reply
Thread Tools

Null Dates

 
 
Craig Buchanan
Guest
Posts: n/a
 
      10-14-2003
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


 
Reply With Quote
 
 
 
 
Sonali.NET[MVP]
Guest
Posts: n/a
 
      10-14-2003
Check out
http://www.c-sharpcorner.com/Code/20...orDateTime.asp
See if you can manipulate with the code in similar manner

"Craig Buchanan" <(E-Mail Removed)> wrote in message
news:e8A0$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
mikeb
Guest
Posts: n/a
 
      10-14-2003
Craig Buchanan wrote:
> 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

--
mikeb

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RFC-822 dates into Ruby dates kellygreer1 Ruby 1 06-08-2008 10:59 PM
Need to use dates earlier than 1900 (Time library says out of range for dates < 1900) me@benjaminarai.com Ruby 1 07-17-2007 02:25 PM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
Dates dates dates dates... SQL and ASP.NET David Lozzi ASP .Net 1 09-30-2005 02:18 PM
Dates! Dates! Dates! PW ASP General 4 08-09-2004 04:42 PM



Advertisments