Solved

How To send NULL value to database

Posted on 2008-06-18
2
240 Views
Last Modified: 2010-04-21
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
Comment
Question by:Ahmadal_najjar2003
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 21819397
DBNull.Value should work out:


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

Open in new window

0
 

Author Closing Comment

by:Ahmadal_najjar2003
ID: 31468670
Yes Really I works out.

Thank a lot .

Ahmad Al-najjar
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question