Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

How To send NULL value to database

I have a stored procedure with parameters , I want to send values from VB 2008 like this

            Dim MyToStoreID As New SqlParameter("ToStoreID", Null) ' as defuat no transfer
            If ToStoreComboBox.Visible Then
                MyToStoreID.ParameterName = "ToStoreID"
                MyStoreID.Value = ToStoreComboBox.SelectedValue
            End If

How can I send a null value . ' My Table field Accept null value
0
Ahmadal_najjar2003
Asked:
Ahmadal_najjar2003
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
DBNull.Value should work out:


Dim MyToStoreID As New SqlParameter("ToStoreID", DBNull.Value) 

Open in new window

0
 
Ahmadal_najjar2003Author Commented:
Yes Really I works out.

Thank a lot .

Ahmad Al-najjar
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now