473,503 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 8804
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2528
by: michael haller | last post by:
In my project i have a textfile witch i import in my c# application. The datas in the textfile i show the datas in the textfile in my datagrid..ok that ist not my problem. Now i have a...
0
1568
by: Steve Bishop | last post by:
I have a form with a search text box and a grid that displays the results. Within the grid, I have edit command links set up to response.redirect to another page that puts the DataKey value in the...
0
3126
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these...
8
3868
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
0
816
by: guy | last post by:
VB2005/SQL Server 2000 I have a dataset which includes a query using a wildcard search. when run from the dataset designer or from Sql Server this works correctly however when calling the dataset...
4
7102
by: Aryan | last post by:
Hi, I am having problem with DataTable.Select() method. I am using ASP.NET 2.0. I have DataSet which reads data from XML file using DataSet.ReadXML(). Now this dataset has various datatable,...
4
2672
by: Cron | last post by:
Hi can someone give me a hand with this please? I'm trying to build a search filter that scans through a list of client names in a database as you type into a text box and filters the form records...
1
1926
by: sheldonlg | last post by:
I have inherited code with a TDC control. In this file, there are two javascripts of interest. One of these is a function, filter(), which is inside <script language=javascript></script>. The...
2
3164
by: Duggi | last post by:
Hi I have a dataview. I would like to apply a filter on the dataview on a column with datatype system.string. I have filter with wild char *. I need to support wild chars * and ? in...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.