Re: Passing Null value to SQL

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 10/21/04


Date: Thu, 21 Oct 2004 18:11:40 +0100

amber <amber@discussions.microsoft.com> wrote:
> I'm not sure if this question should go in the SQL forum or this one...
>
> I'm using VB.NET and SQL Server.
> I'm using stored procedures to update and create new records in my database.
> On the form I'm working on, I have 2 date fields.
> I want the user to have the option of leaving these blank.
> I do not want default values.
> I'm getting error messages not matter what I try.
> What syntax can I use to get VB to pass this null value instead of a date,
> into SQL??

Use a parameter and set the value to DBNull.Value.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: Unable to Apply SP4 to SQL 2000 Cluster (new Node)
    ... Rebuild the node in the failover cluster. ... Scenario 1" in SQL Server 2000 Books Online. ... This setup process updates to SP4 only the binaries on the new ...
    (microsoft.public.sqlserver.clustering)
  • Re: WSS 3.0 question
    ... I followed the advise given in removing WSS 3.0 etc, ... the server is complaining that the SQL service(?) was tempered with or corrupt. ... I may just instal the SQL server as I was going eventuall use it anyway. ... If WSUS 3.0 is installed, I would suggest you uninstall it and then you install WSS 3.0. ...
    (microsoft.public.windows.server.sbs)
  • Re: WSUS
    ... I'm not seeing performance issues with the full enchilada installed, and 25 users busy hitting SQL. ... WSUS isn't difficult to uninstall - if you have WSUS v2 (installed with SBS R2) uninstall R2 from add/remove programs. ... How can anyone work with 4 instances of SQL Server on the same box? ...
    (microsoft.public.windows.server.sbs)
  • Re: SQL Server 2005 Cluster Setup Quiz
    ... I did test and it did not install the client tools. ... http://www.clusterhelp.com - Cluster Training ... Microsoft SQL Server MVP ... Provide a template on how to read SQL Server 2005 setup log files. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Cannot setup SQL Mail on SBS 2003
    ... Microsoft CSS Online Newsgroup Support ... Cannot setup SQL Mail on SBS 2003 ... The account you use to start the SQL Server service must be a domain ...
    (microsoft.public.windows.server.sbs)