How pass null in VB to field of a table of sqlserver?

  • Hello friends do you know how to pass null value to a variable in VB for insert a null into a table or to pass like input parameter to sp???

     

    example

     

    Dim a as integer

    Dim strquery as string

    a = null ' this is my problem null of VB is different to a null of sql server

    strquery = " insert into CT_Mytable value(" & a & "&nbsp"

     

    thank you your help

  • try using this.......

    Dim lsTemp as String

    lsTemp ="NULL"

    or lsTemp = vbNull

     

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply