Blank value

Results 1 to 3 of 3

Thread: Blank value

  1. #1
    Join Date
    Dec 1969

    Default Blank value

    The code:<BR>if (Session("DOB") is system.dbnull.value) OR (Session("DOB") = " ") then<BR> messageno = messageno + 1<BR>end if<BR><BR>Error caused by the above code:<BR>system.invalidcastexception:Cast from string "" to type "Date" is not valid.<BR><BR>Session is derived by the sql query (DOB may be null or blank sometime):<BR>sql = "SELECT nvl(BIRTH_DAY,&#039; &#039;) As DOB from CUSTOMER_DETAILS"<BR><BR>After putting the value into the dataset, I put the value from the dataset into the session.<BR>Session("DOB")= DBRow("DOB")

  2. #2
    Join Date
    Dec 1969

    Default Try IsNothing instead

    If Not IsNothing(Session("DOB")) then<BR> messageno = messageno + 1<BR>end if

  3. #3
    Join Date
    Dec 1969

    Default RE: Blank value

    Could also try...<BR><BR>If Not(Session("DOB").String.Empty) Then<BR>... do something...<BR>End If

Posting Permissions

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