--Using RowFilter for filtering special charactered column data--

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

Guest

Hi
Can we use DataView.RowFilter for filteing special charactered column data
like
if the column data includes the characters like "<" ">" "(".I have tried by
enclosing the above mentioned characters in "[]" but i'm not successful.
Eg. "Srinivas<>("
Dataview.RowFilter = "Column Name LIKE "'Srinivas[<][>][(]'".
Thanks,
Srinivas.
 
Hi Srinivas,

First of all, when using ‘LIKE’ for RowFilter, you should have wildcard (%,
_) in expression.

Secondly, ‘<’, ‘>’, and ‘(‘ are not special characters.

I guess you might use following expression or something simular to achieve
your search.

Dataview.RowFilter = "FieldName LIKE 'Srinivas_' AND (FieldName LIKE '%<' OR
FieldName LIKE '%>' OR FieldName LIKE '%(')"

HTH

Elton Wang
(e-mail address removed)
 
Hi Elton,

Thanks for your response.
I have tried your approach but even this does'nt work.
Let me explain how i have done.Say for eg i have a Column by name 'Name'.
The column 'Name' values are "<","<","(".Now if i apply
Dataview.RowFilter = "Name LIKE '%<'" for the 'Name' column i should get 2
rows.
But the rows are not filtered.I even tried with
Dataview.RowFilter = "Name LIKE '%<%'"

Thanks,
Srinivas.


Elton W said:
Hi Srinivas,

First of all, when using ‘LIKE’ for RowFilter, you should have wildcard (%,
_) in expression.

Secondly, ‘<’, ‘>’, and ‘(‘ are not special characters.

I guess you might use following expression or something simular to achieve
your search.

Dataview.RowFilter = "FieldName LIKE 'Srinivas_' AND (FieldName LIKE '%<' OR
FieldName LIKE '%>' OR FieldName LIKE '%(')"

HTH

Elton Wang
(e-mail address removed)


Srinivas Jeebula said:
Hi
Can we use DataView.RowFilter for filteing special charactered column data
like
if the column data includes the characters like "<" ">" "(".I have tried by
enclosing the above mentioned characters in "[]" but i'm not successful.
Eg. "Srinivas<>("
Dataview.RowFilter = "Column Name LIKE "'Srinivas[<][>][(]'".
Thanks,
Srinivas.
 
Normally 'Name' is reserved word. Hence you need to use [fieldName] to
explicitly show it's filed. You can try

Dataview.RowFilter = "[Name] LIKE '%<%'";

HTH

Elton
 
RE: Using RowFilter for filtering special charactered column data

I've tried your example, because I thought it must work (even without using [] brackets).
So, column name was "Name", there were 3 rows with values "<", "<" and "(" and the filter expression was "Name LIKE '%<'" and ... it works! It filtered 2 rows, so I think your problem was somewhere else.

See the article DataView.RowFilter Syntax which explains how to use RowFilter expression. There are examples how to use LIKE operator and how to escape special characters in values.
 
Back
Top