473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

query in dataview.rowfilter

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%' "

any idea ?
JMT

Jul 23 '05 #1
2 5965
Hi

You don't say what the different queries produce and why they are wrong?

I would expect dv.rowfilter = " Title like '[a-j]%' " to work unless you
have a case sensitive database.

dv.rowfilter = " Title like 'a%'" AND "Title like 'b%'" AND..so on
will not work as you are using AND instead of OR

John

"vbnetrookie" <bi****@hotmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
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%' "

any idea ?
JMT

Jul 23 '05 #2
[posted and mailed]

vbnetrookie (bi****@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, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew Mueller | last post by:
Hello, Since I cannot query a DataSet directly, and I would like to maintain it's data, how would I use an adapter (SqlDataAdapter or DataAdapter) to query this DataSet. Example: Could I? ...
2
by: Ryan Moore | last post by:
I have a dataset (called adset) which has a column called "Large" which is either an integer 0 or 1. I am creating 2 dataviews, one which should display the 1's and one which should display the...
8
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
8
by: KC | last post by:
For a DataView.Rowfilter can I use more than one expression? I want to filter out two different things. For example can I take: dv.RowFilter = "MTX <> 'Customer Forcast'" and ...
7
by: randy1200 | last post by:
I have an orders table. Each record in the orders table contains a customer id. I have a customer table. The primary key of each record in the customer table is the customer id. After getting...
0
by: neeraj | last post by:
Hi, all Could anny one give me help how can I use like operator with these data types "integer , datetime or boolean" in DataView.RowFilter Actually when I try to get the data from dataview...
2
by: neeraj | last post by:
Hi, all Could anny one give me help how can I use like operator with these data types "integer , datetime or boolean" in DataView.RowFilter Actually when I try to get the data from dataview...
1
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
5
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.