dateTime = Null problem

Discussion in 'ASP .Net' started by Jake, Jul 18, 2003.

  1. Jake

    Jake Guest

    Hi All,

    I have an object that ahs a property of time dateTime,
    this property is set to the contents of a DateTime field
    in the database(SQL Server).

    The problem I am haveing is that if the dataabase field
    is Null and the object property is set to the contense of
    that field. And I then assign the object proberty to the
    value of a control the control value is set to 01/01/0001
    instead of "". Any ideas on how to acheive this?

    I can initialize teh value of the property to
    say "1/1/1900" and test for that but is the a neater way?

    And if i test for Isdate() i recieve an error.

    Thanks in advance

    Cheers Jake
     
    Jake, Jul 18, 2003
    #1
    1. Advertising

  2. Jake

    Souri Challa Guest

    Jake,

    You might want to retrieve it from the backend as
    'isnull(<databasefieldname>,'01/01/1900')

    -Souri

    "Jake" <> wrote in message
    news:0fcc01c34cd2$0c2106c0$...
    > Hi All,
    >
    > I have an object that ahs a property of time dateTime,
    > this property is set to the contents of a DateTime field
    > in the database(SQL Server).
    >
    > The problem I am haveing is that if the dataabase field
    > is Null and the object property is set to the contense of
    > that field. And I then assign the object proberty to the
    > value of a control the control value is set to 01/01/0001
    > instead of "". Any ideas on how to acheive this?
    >
    > I can initialize teh value of the property to
    > say "1/1/1900" and test for that but is the a neater way?
    >
    > And if i test for Isdate() i recieve an error.
    >
    > Thanks in advance
    >
    > Cheers Jake
     
    Souri Challa, Jul 18, 2003
    #2
    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. Christos TZOTZIOY Georgiou
    Replies:
    3
    Views:
    732
    Christos TZOTZIOY Georgiou
    Sep 13, 2003
  2. Tim Peters
    Replies:
    0
    Views:
    555
    Tim Peters
    Sep 9, 2003
  3. mp
    Replies:
    1
    Views:
    402
    John Machin
    Jul 28, 2006
  4. Martin
    Replies:
    0
    Views:
    350
    Martin
    Dec 27, 2008
  5. Replies:
    2
    Views:
    774
    M.-A. Lemburg
    Jan 6, 2009
Loading...

Share This Page