Results 1 to 3 of 3

Thread: null fields insert Q

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2003
    Location
    Eire
    Posts
    18

    null fields insert Q

    Hi,

    I'm trying to insert records to my dbase from my web app. I can get all the data into the appropriate fields...as long as there's an entry. I was trying to do a simple if statement to catch fields left blank, I just can't remember what to do with it when I do!

    Code:
            dim nl as System.dbNull
    
            If (Name = "") Then
                Name = nl.ToString
                sql_addStaticValues += " ' " + Name + " ',"
            End If
    I know you have to insert a dbNull instead or an empty value but am just unsure how to do it.
    Thanks

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Use..

    Code:
      DBNull.Value

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2003
    Location
    Eire
    Posts
    18
    sorry...where?
    It just keeps saying that it's not compatible with the string value

Posting Permissions

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



Click Here to Expand Forum to Full Width