By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,296 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,296 IT Pros & Developers. It's quick & easy.

Problem in filter the Dataset value using wildcard like % ?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.