Solved

How To send NULL value to database

Posted on 2008-06-18
2
239 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 142

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

821 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