Solved

How To send NULL value to database

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
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…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now