473,503 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
+ 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 2574
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
5966
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
2282
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
3867
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
5865
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
4765
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
6033
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
1480
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
18881
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
2688
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
11808
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
7083
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
7456
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
5578
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
5011
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
3166
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
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.