Re: Passing Null value to SQL
From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 10/21/04
- Next message: Sriram Krishnan: "Re: XP visual style"
- Previous message: Jon Skeet [C# MVP]: "Re: Get rid of "Visual Studio Projects" folder from My Documents?"
- In reply to: amber: "Passing Null value to SQL"
- Next in thread: Sriram Krishnan: "Re: Passing Null value to SQL"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Sriram Krishnan: "Re: XP visual style"
- Previous message: Jon Skeet [C# MVP]: "Re: Get rid of "Visual Studio Projects" folder from My Documents?"
- In reply to: amber: "Passing Null value to SQL"
- Next in thread: Sriram Krishnan: "Re: Passing Null value to SQL"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|