Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: VbNull = 1

Results 1 to 5 of 5
Share This Thread →
  1. #1
    swbouse's Avatar
    swbouse is offline Contributing User
    Join Date
    Jun 2004
    Location
    Phx. AZ
    Posts
    221
    Rep Power
    11

    VbNull = 1

    Apperently vbNull is equal to 1, um ok. How do I pass a null value to the db?
    Code:
    cmdSQL.Parameters.Add("@param", SqlDbType.Int).Value = vbNull

  2. #2
    micky's Avatar
    micky is offline Couch Potato Wizard
    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    well experts say that storing a null value in database is not a good idea, but anyway, have u tried this?
    Code:
    cmdSQL.Parameters.Add("@param", SqlDbType.Int).Value = Null
    Laziness is my religion and Sunday is my God

    Get the Mantra!

  3. #3
    swbouse's Avatar
    swbouse is offline Contributing User
    Join Date
    Jun 2004
    Location
    Phx. AZ
    Posts
    221
    Rep Power
    11
    nope, VB thinks I am using a variable. I even tried declaring null as system.dbnull.

  4. #4
    swbouse's Avatar
    swbouse is offline Contributing User
    Join Date
    Jun 2004
    Location
    Phx. AZ
    Posts
    221
    Rep Power
    11
    I figured it out. It need the value property.

    Code:
    cmdSQL.Parameters.Add("@param", SqlDbType.Int).Value = system.dbnull.value

  5. #5
    micky's Avatar
    micky is offline Couch Potato Wizard
    Join Date
    Jan 2005
    Location
    India
    Posts
    13,652
    Rep Power
    2685
    glad u sorted it out and thanx for sharing the solution

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

ASP Free Advertisers and Affiliates