Solved

DataView: Using Regular Expression in RowFilter

Posted on 2008-06-13
1
1,833 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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