|
Posted by Erland Sommarskog on 06/05/05 00:01
[posted and mailed]
vbnetrookie (bigjmt@hotmail.com) writes:
> In the dataview rowfilter property, how can I say that I just want
> Titles that start with 'A' to 'J' ??
>
> ex:
> dv.rowfilter = " Country = ' France ' "
>
> I want
> dv.rowfilter = " Title = (from 'A' to 'J') "
>
> This doesn't work :
> dv.rowfilter = " Title like '[a-j]%' "
>
> Neither does :
> dv.rowfilter = " Title like 'a%'" AND "Title like 'b%'" AND..so on
>
> But this does work just for the Titles starting with 'a'
> dv.rowfilter = " Title like 'a%' "
Assume that this is really SQL passed to SQL Server, my bets goes to:
dv.rowfilter = " Title like '[ABCDEFGHIJ]%' "
But I believe you are in the wrong newsgroup. It looks to me that
you are using a row filter on the DataView object, and they have their
own syntax. As I can read out from the book I have on ADO .Net, it does
not seem that you can use [] as wildcards in a row filter. In such case
you would have to use:
dv.rowfilter = " Title like 'a%'" OR "Title like 'b%'" OR..so on
To get real certainty, you should frequent
microsoft.public.dotnet.framework.adonet.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
[Back to original message]
|