jazzIIIlove
asked on
DataView.RowFilter alternative for regex [A-Z]
Hi there;
I am stuck in a rowfilter that should be using [A-K]* as regex, but simply, it gives an exception and find out that this kind of regex is not work for DataView. So, for such regex what is the workaround?
It's a VB example, though addresses to my problem:
http://bytes.com/topic/visual-basic-net/answers/378785-regular-expressions-dataview-rowfilter
Kind regards.
I am stuck in a rowfilter that should be using [A-K]* as regex, but simply, it gives an exception and find out that this kind of regex is not work for DataView. So, for such regex what is the workaround?
It's a VB example, though addresses to my problem:
http://bytes.com/topic/visual-basic-net/answers/378785-regular-expressions-dataview-rowfilter
Kind regards.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Ok, could you provide me an equivalent linq query for this very SQL query.
SELECT * FROM books WHERE bookID LIKE '[A-P]%';
Kind regards.
SELECT * FROM books WHERE bookID LIKE '[A-P]%';
Kind regards.
ASKER
Please...any help?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Hi;
Thanks for your contributions. :)
"Right after your code", I append the following lines as:
DataTable selection = query.CopyToDataTable();
myGrid.DataSource = selection;
or should I just append as below:
myGrid.DataSource = query;
Both seem working, but I couldn't decide, please note that I am new to linq to dataview.
Kind regards.
Thanks for your contributions. :)
"Right after your code", I append the following lines as:
DataTable selection = query.CopyToDataTable();
myGrid.DataSource = selection;
or should I just append as below:
myGrid.DataSource = query;
Both seem working, but I couldn't decide, please note that I am new to linq to dataview.
Kind regards.
you must use linq or looping for you filtering needs.