Solved

DataView: Using Regular Expression in RowFilter

Posted on 2008-06-13
1
1,882 Views
Last Modified: 2008-06-15
I am trying to figure out how to use a regular expression in a dataview's RowFilter. In PHP, it looks like this:
`field` REGEXP '[[:<:]]word[[:>:]]', which will find instances in the MySQL table where "word" has a word boundary on it. This is what I tried in vb.Net:
dv.RowFilter = "[field] REGEXP '\bword\b'" and I also tried dv.RowFilter = "[field] REGEXP '[[:<:]]word[[:>:]]'". Both of these return this error:
Syntax error: Missing operand after 'REGEXP' operator. Can someone tell me what I am doing wrong? Thanks.
0
Comment
Question by:rbichon
1 Comment
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 21782785
Hi rbichon;

You can't execute a regular expression with in the RowFilter property of the DataView. The RowFilter property gets or sets the expression used to filter which rows are viewed in the DataView. The expression can be built using the tokens from the following documentation.

http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx

Look starting at the remarks section.

Fernando
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now