Home All Groups Group Topic Archive Search About

Pass DATE NULL to Stored Procedure.

Author
21 Jan 2006 7:35 PM
hemant
I have a date parameter, and i want to pass Date as NULL to the stored
procedure, I dont know how to pass null for the date field.

All suggestions welcome and appreciated.
--
Hemant Singh

Author
21 Jan 2006 8:50 PM
Miha Markic [MVP C#]
Pass DBNull.Value.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Show quote
"hemant" <hem***@discussions.microsoft.com> wrote in message
news:AF2F5D55-74F0-47A4-8B87-949DD358B42F@microsoft.com...
>I have a date parameter, and i want to pass Date as NULL to the stored
> procedure, I dont know how to pass null for the date field.
>
> All suggestions welcome and appreciated.
> --
> Hemant Singh
>
>
Author
21 Jan 2006 9:39 PM
Elton W
In addition to  Miha's solution, you can also set  the parameter's default
value to null in SP. If you don't pass the parameter value to SP, it takes
null.

HTH

Elton Wang

Show quote
"hemant" wrote:

> I have a date parameter, and i want to pass Date as NULL to the stored
> procedure, I dont know how to pass null for the date field.
>
> All suggestions welcome and appreciated.
> --
> Hemant Singh
>
>

AddThis Social Bookmark Button