Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

DataView: Using Regular Expression in RowFilter

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

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SELECT query on two levels (detail and summary) 13 57
Import Data from Multiple Text Files in Excel 12 58
VB.NET 2008 Winforms Signing 13 30
Combining Queries 7 27
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

789 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