Problem in filter the Dataset value using wildcard like % ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

In our Project we use Dataset to load the Grid with Values.

We have some criteria to filter the values to be shown in the Grid.
For that we used the SELECT command to filter the Same Dataset.

The SELECT Command we are using is as follows

DS.Tables(0).Select("FieldName = '" & input value & "')

Its Working fine in all situations except filter using % e.g. a%a%a.

This SELECT command works fine with % in the following situations

a) filter string as %%%%.
b) filter string as a%%%%0.
c) filter string as a%a

Now only situation it fails is
filter string like a%a%, a%a%a, a%a%%, ...

we know very well that this filter strings are valid in the Database
Query Where Conditions.

we like to know that Is any specific reason why it is not working in
Dataset ? or anything wrong in our Query approach.

Let me know if anyone has some other solution for this situation
or suggestions.

Thanks in Advance
Anandan k
 
Hi,

I think you would be better off using the dataview's rowfilter
method but either way you need to use Like instead of = for wildcards.

DS.Tables(0).defaultview.rowfilter = "FieldName Like '" & input value & "'

Ken
---------------------
Hi,

In our Project we use Dataset to load the Grid with Values.

We have some criteria to filter the values to be shown in the Grid.
For that we used the SELECT command to filter the Same Dataset.

The SELECT Command we are using is as follows

DS.Tables(0).Select("FieldName = '" & input value & "')

Its Working fine in all situations except filter using % e.g. a%a%a.

This SELECT command works fine with % in the following situations

a) filter string as %%%%.
b) filter string as a%%%%0.
c) filter string as a%a

Now only situation it fails is
filter string like a%a%, a%a%a, a%a%%, ...

we know very well that this filter strings are valid in the Database
Query Where Conditions.

we like to know that Is any specific reason why it is not working in
Dataset ? or anything wrong in our Query approach.

Let me know if anyone has some other solution for this situation
or suggestions.

Thanks in Advance
Anandan k
 
Hi,

Again i have face the same problem and the following message has come

Error in Like operator: the string pattern '%a%a%' is invalid.


Let me know if anyone has some other solution for this situation
or suggestions.


Thanks in Advance
Anandan k


Ken Tucker said:
Hi,

I think you would be better off using the dataview's rowfilter
method but either way you need to use Like instead of = for wildcards.

DS.Tables(0).defaultview.rowfilter = "FieldName Like '" & input value & "'

Ken
---------------------
Hi,

In our Project we use Dataset to load the Grid with Values.

We have some criteria to filter the values to be shown in the Grid.
For that we used the SELECT command to filter the Same Dataset.

The SELECT Command we are using is as follows

DS.Tables(0).Select("FieldName = '" & input value & "')

Its Working fine in all situations except filter using % e.g. a%a%a.

This SELECT command works fine with % in the following situations

a) filter string as %%%%.
b )filter string as a%%%
 

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

Back
Top