SDL Data Adapter and Parameter

  • Thread starter Brian P. Hammer
  • 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
 
M

Miha Markic

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top