Null Dates

Discussion in 'ASP .Net' started by Craig Buchanan, Oct 14, 2003.

  1. 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 Buchanan, Oct 14, 2003
    #1
    1. Advertising

  2. Check out
    http://www.c-sharpcorner.com/Code/2003/Sept/EnterNullValuesForDateTime.asp
    See if you can manipulate with the code in similar manner

    "Craig Buchanan" <> wrote in message
    news:e8A0$...
    > 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
    >
    >
     
    Sonali.NET[MVP], Oct 14, 2003
    #2
    1. Advertising

  3. Craig Buchanan

    mikeb Guest

    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
     
    mikeb, Oct 14, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lozzi

    Dates dates dates dates... SQL and ASP.NET

    David Lozzi, Sep 29, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    867
    Rob Schieber
    Sep 30, 2005
  2. Replies:
    5
    Views:
    26,687
    Mike Schilling
    Mar 29, 2006
  3. PW

    Dates! Dates! Dates!

    PW, Aug 7, 2004, in forum: ASP General
    Replies:
    4
    Views:
    197
    Mark Schupp
    Aug 9, 2004
  4. Replies:
    1
    Views:
    206
    Jano Svitok
    Jul 17, 2007
  5. kellygreer1

    RFC-822 dates into Ruby dates

    kellygreer1, Jun 8, 2008, in forum: Ruby
    Replies:
    1
    Views:
    199
    Eric I.
    Jun 8, 2008
Loading...

Share This Page