473,473 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

rowfilter

I know how to filter on 1 row from the dataset using a dataview.
How can i filter on 2 rows being returned?

example:
i need to only display
data1.value > 0 and <= 25
data2.value > 0 and <= 25.

is there anyway to do this
Nov 18 '05 #1
4 2572
IGotYourDotNet <IG************@discussions.microsoft.com> typed:
I know how to filter on 1 row from the dataset using a dataview.
How can i filter on 2 rows being returned?

example:
i need to only display
data1.value > 0 and <= 25
data2.value > 0 and <= 25.

is there anyway to do this


Try this:

myDataView.RowFilter = "(data1 > AND data1 <= 25) AND (data2 > AND data2 <=
25)";

where data1 and data2 are ColumnName

See this link for more info about Expression syntax in RowFilter property:
http://msdn.microsoft.com/library/de...ssiontopic.asp

--
Davide Vernole
MVP ASP/ASP.NET
Microsoft Certified Solution Developer
Nov 18 '05 #2
something like....

DataView.RowFilter = "[data1] > 0 AND [data2] > 0 AND [data1] <= 25 AND
[data2] <= 25";

mark
www.dovetaildatabases.com

"IGotYourDotNet" <IG************@discussions.microsoft.com> wrote in message
news:B0**********************************@microsof t.com...
I know how to filter on 1 row from the dataset using a dataview.
How can i filter on 2 rows being returned?

example:
i need to only display
data1.value > 0 and <= 25
data2.value > 0 and <= 25.

is there anyway to do this

Nov 18 '05 #3
your dataview's row filter supports the AND and OR keyword..

"how can I filter on 2 rows being returned" do you mean 2 tables? where one
is called Data1 and the other is called Data2? Assuming that's what you
mean, you can create a DataRelation..

something like:
ds.Relations.Add(new DataRelation("Data1ToData2",
ds.Tables("Data1").Columns("ParentColumn"),
ds.Tables("Data2").Columns("ChildColumn"))

Dim dv As DataView = ds.Tables("Data1").DefaultView
dv.RowFilter = "Value > 0 and Value < 25 AND Child.Value > 0AND
Child.Value < 25"

now that's just off the top of my head, but look into datarelations and the
MS-Help for Data expressions:
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemdatadat
acolumnclassexpressiontopic.htm

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"IGotYourDotNet" <IG************@discussions.microsoft.com> wrote in message
news:B0**********************************@microsof t.com...
I know how to filter on 1 row from the dataset using a dataview.
How can i filter on 2 rows being returned?

example:
i need to only display
data1.value > 0 and <= 25
data2.value > 0 and <= 25.

is there anyway to do this

Nov 18 '05 #4
Davide Vernole [MVP] <da****@online.knodev.com> typed:
Try this:

myDataView.RowFilter = "(data1 > AND data1 <= 25) AND (data2 > AND
data2 <= 25)";


Ops ! A little mistake :-D. This sould be correct ;-)

myDataView.RowFilter = "(data1 > 0 AND data1 <= 25) AND (data2 > 0 AND data2
<= 25)";

--
Davide Vernole
MVP ASP/ASP.NET
Microsoft Certified Solution Developer
Nov 18 '05 #5

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

Similar topics

2
by: vbnetrookie | last post by:
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...
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 =...
9
by: Marty McFly | last post by:
Greetings, I'm trying to let my users dynamically filter records from a table that relate to other tables. RELATIONSHIPS: . = . . = . There is a Many-to-Many relationship between...
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 ...
4
by: Georg Schmelzer | last post by:
Hi Ng, need some help here. What's wrong with that dataview.rowfilter expression: dtFliste.DefaultView.RowFilter = "Field1 Like '%" & strFV & "%'" & _ " AND Field2 Like '%" & strFS & "%'" &...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.