dateTime = Null problem

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default dateTime = Null problem

    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 Guest

  2. Similar Questions and Discussions

    1. DateTime Problem with .NET WebService
      I am using Flash with the WebService class (via actionscript) to interact with an ASP.NET 2.0 XML Web Service. When retrieving information that is...
    2. DateTime problem
      Hi, I posted a question a few days ago in the Getting Started board but never got an answer. But I have figured out where my problem lies-- it has...
    3. NULL To DateTime field through sp
      How can I insert null value into a datetime field through stored procedure? i use cybase,cf 4
    4. update row with null numeric or datetime dataset cell values in a datagrid
      I keep getting the, now, dreaded "System.FormatException: String was not recognized as a valid DateTime" error when updating a datagrid row that has...
    5. Set a datetime field to Null
      Hi I created a record set at client side and added a coulmn as date time DBRS = CreateObject("ADODB.RecordSet") DBRS.Fields.Append...
  3. #2

    Default Re: dateTime = Null problem

    Jake,

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

    -Souri

    "Jake" <reachJake@hotmail.com> wrote in message
    news:0fcc01c34cd2$0c2106c0$3501280a@phx.gbl...
    > 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 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139