?
Solved

Insert Null into sql??

Posted on 2003-12-04
1
Medium Priority
?
554 Views
Last Modified: 2012-05-04
Hey so I have a sql insert string we'll say:
Insert INTO FooTable (val1,val2,val3) values (@val1,@val2,@val3)

I go through and add the parameters.
Now when adding the values, that can depend on what is read by the application. The problem is if the value is null.
if it is null I want to have the database be null. But the requirement for this null changed from when I originally built the app, so I can't have it dynamically create the string. Basically I want to know if I can have the value = null?

0
Comment
Question by:jj819430
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 18

Accepted Solution

by:
testn earned 2000 total points
ID: 9876705
Just set the parameter to DBNull.Value
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

752 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