SDL Data Adapter and Parameter

  • Thread starter Thread starter Brian P. Hammer
  • Start date Start date
B

Brian P. Hammer

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
 
Hi Brian,


Brian P. Hammer said:
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).
 
Back
Top