All,

What or how should I go about using a data adapter parameter? Here is my
question.

I have a data adapter and some records are filtered with @ContactID.
Sometimes I want to add an additional parameter to this of @ClientID. As
expected, if I add this to the data adapter configuration, I have to supply
a value for it. So, is there a string or character like'*' that will return
all the records.

In essence, I want to be able to do:

With daLead.SelectCommand.Parameters
.Item("@ContactID").Value = 123
.Item("@ClientD").Value = "Every Single integer. Something like *"
End With

OR at other times....

With daLead.SelectCommand.Parameters
.Item("@ContactID").Value = 123
.Item("@ClientD").Value = 567
End With



--
Brian P. Hammer

Re: SDL Data Adapter and Parameter by Miha

Miha
Wed Jan 07 16:14:31 CST 2004

Hi Brian,


"Brian P. Hammer" <bphammer@hotmail.com> wrote in message
news:e$rglZV1DHA.2328@TK2MSFTNGP10.phx.gbl...
> All,
>
> What or how should I go about using a data adapter parameter? Here is my
> question.
>
> I have a data adapter and some records are filtered with @ContactID.
> Sometimes I want to add an additional parameter to this of @ClientID. As
> expected, if I add this to the data adapter configuration, I have to
supply
> a value for it. So, is there a string or character like'*' that will
return
> all the records.

No, there is no such way.
There are workarounds though - you might pass DBNull.Value (null for DB) and
make select to act as ignore the parameter when null value is passed.

Or you might add another parameter of type boolean that tell whether to
ignore or not certain other parameter - this too has to be implemented at
database level (sql statament).

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com



Re: SDL Data Adapter and Parameter by Brian

Brian
Wed Jan 07 20:02:29 CST 2004

Thanks Miha, I'll give it a try.



--
Brian P. Hammer
"Miha Markic" <miha at rthand com> wrote in message
news:us%23SiuW1DHA.556@TK2MSFTNGP11.phx.gbl...
> Hi Brian,
>
>
> "Brian P. Hammer" <bphammer@hotmail.com> wrote in message
> news:e$rglZV1DHA.2328@TK2MSFTNGP10.phx.gbl...
> > All,
> >
> > What or how should I go about using a data adapter parameter? Here is
my
> > question.
> >
> > I have a data adapter and some records are filtered with @ContactID.
> > Sometimes I want to add an additional parameter to this of @ClientID.
As
> > expected, if I add this to the data adapter configuration, I have to
> supply
> > a value for it. So, is there a string or character like'*' that will
> return
> > all the records.
>
> No, there is no such way.
> There are workarounds though - you might pass DBNull.Value (null for DB)
and
> make select to act as ignore the parameter when null value is passed.
>
> Or you might add another parameter of type boolean that tell whether to
> ignore or not certain other parameter - this too has to be implemented at
> database level (sql statament).
>
> --
> Miha Markic - RightHand .NET consulting & development
> miha at rthand com
> www.rthand.com
>
>