Hi,

For any of the microsoft guys :
Is there a way to tell ADO.Net to use a default value from the stored
procedure ?
I know the only way to do it is to not create the default parameter at all
in the command but i am looking for an elegant solution to tag it to use the
default value from the sproc. Query analyzer supports the 'default' keyword
is there an equivalent in ADO.Net ?

Thanks!

Re: Set Default Value SqlParameter by William

William
Thu Sep 01 16:33:14 CDT 2005

I'm only a former Microsoft guy, but I'll bet some of the Microsoft gals
could answer this as well... ;)
To get ADO.NET to get the SP to use the server-side defined default value
you need to either:
1) Skip the parameter and not add it to the Parameters collection.
2) Set the Value property of the Parameter object to Nothing in VB.NET or
Null in C#.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Vish" <Vish@discussions.microsoft.com> wrote in message
news:BF3249C0-4F50-4C43-8392-FF8D34E80C16@microsoft.com...
> Hi,
>
> For any of the microsoft guys :
> Is there a way to tell ADO.Net to use a default value from the stored
> procedure ?
> I know the only way to do it is to not create the default parameter at all
> in the command but i am looking for an elegant solution to tag it to use
> the
> default value from the sproc. Query analyzer supports the 'default'
> keyword
> is there an equivalent in ADO.Net ?
>
> Thanks!