Hi,

We have written small stored procedure for reading data to dataset. Stored
procedure has total three parameters, in one is mandatory and another two has
default values. If we use SQL Command object or SQL Data Adapter we need not
declare the SQL Parameters for the optional parameters in the stored
procedure(parameters with the default valuse).

Here we are using Microsoft.ApplicationBlocks.Data, when we are passing the
one parameter to the SQLHelper class of method FillDataSet, it is giving error

"Parameter count does not match parameter value count".

Becuse the SqlHelperParameterCache.GetSpParameterSet is returning the three
parameters and it is not returning the optional parameter values.

How to pass parameters to the SQLHelper class when the procedure has
optional parameters. Please help us

Thanks in advance

Regards
Satish

Re: Optional Parameters values of Stored procedures using Applicationb by W

W
Tue May 31 21:07:57 CDT 2005

There are a few ways to handle it depending on the specific implementation
of SqlHelper you're employing - but the short answer is that if you pass in
Nulls for instance (or Nothing in VB.NET - I mean the literal Null - not
DbNull.Value), then that should get you over the hurdle provided you have
default values specified in the procedure.

--
W.G. Ryan MVP (Windows Embedded)

TiBA Solutions
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Satish" <Satish@discussions.microsoft.com> wrote in message
news:6B5936D9-A497-4D77-8CA9-C421769609DA@microsoft.com...
> Hi,
>
> We have written small stored procedure for reading data to dataset. Stored
> procedure has total three parameters, in one is mandatory and another two
has
> default values. If we use SQL Command object or SQL Data Adapter we need
not
> declare the SQL Parameters for the optional parameters in the stored
> procedure(parameters with the default valuse).
>
> Here we are using Microsoft.ApplicationBlocks.Data, when we are passing
the
> one parameter to the SQLHelper class of method FillDataSet, it is giving
error
>
> "Parameter count does not match parameter value count".
>
> Becuse the SqlHelperParameterCache.GetSpParameterSet is returning the
three
> parameters and it is not returning the optional parameter values.
>
> How to pass parameters to the SQLHelper class when the procedure has
> optional parameters. Please help us
>
> Thanks in advance
>
> Regards
> Satish