468,306 Members | 1,220 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,306 developers. It's quick & easy.

Problem in filter the Dataset value using wildcard like % ?

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
Nov 21 '05 #1
2 8501
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
---------------------
"Anandan" <An*****@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
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
Nov 21 '05 #2
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 [MVP]" wrote:
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
---------------------
"Anandan" <An*****@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
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%%%
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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by michael haller | last post: by
reply views Thread by Steve Bishop | last post: by
reply views Thread by Chris Ericoli | last post: by
8 posts views Thread by Dave Hagerich | last post: by
reply views Thread by guy | last post: by
4 posts views Thread by Aryan | last post: by
1 post views Thread by sheldonlg | last post: by
2 posts views Thread by Duggi | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.