473,407 Members | 2,326 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,407 software developers and data experts.

How do I code for a compound conditional in the DataView.RowFilter?

I am trying to code for a compound conditional in the DataView.RowFilter but
don't quite no how to do the correct syntax for this.

The following code sample chokes on dv.RowFilter:

int batchid = 123456;
int segment = 3;

DataView dv = new DataView(ds.taxBatch);
dv.RowFilter = "BatchID = " + batchid + " && Segment = " + segment;
string agencyid = dv[0]["AgencyID"].ToString();
Nov 15 '05 #1
2 3941
Top Gun wrote:
I am trying to code for a compound conditional in the
DataView.RowFilter but don't quite no how to do the correct syntax
for this.

The following code sample chokes on dv.RowFilter:

int batchid = 123456;
int segment = 3;

DataView dv = new DataView(ds.taxBatch);
dv.RowFilter = "BatchID = " + batchid + " && Segment = " + segment;
string agencyid = dv[0]["AgencyID"].ToString();


Try "AND" instead of "&&".

- Pete
Nov 15 '05 #2
Top Gun,
In addition to the other comments:

The only place I know of where the syntax that expressions (such as
RowFilter) in the DataSet OM
is documented is the DataColumn.Expression help topic:

http://msdn.microsoft.com/library/de...ssionTopic.asp

Hope this helps
Jay

"Top Gun" <nf*@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am trying to code for a compound conditional in the DataView.RowFilter but don't quite no how to do the correct syntax for this.

The following code sample chokes on dv.RowFilter:

int batchid = 123456;
int segment = 3;

DataView dv = new DataView(ds.taxBatch);
dv.RowFilter = "BatchID = " + batchid + " && Segment = " + segment;
string agencyid = dv[0]["AgencyID"].ToString();

Nov 15 '05 #3

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

Similar topics

3
by: Coco | last post by:
Hi! I managed to display chinese character in my web form (.aspx), in certain situation i need to to set the text of the label of my web form in chinese character programatically which is done in...
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...
3
by: Randy | last post by:
Hello All, I'm trying to use a DataView and in the rowfilter, base it on two fields in the table. I can't find any examples on this. Is there a way to do it. I'm talking about something like......
1
by: Webgour | last post by:
I'm tring to filter a dataview with multiple rowfilters. The problem is that each time I use RowFilter on the DataView i'm quering the full dataview as it was loaded, not the filtered version. Is...
3
by: Siegfried Heintze | last post by:
I'm displaying information on job postings in various cities. For example, might have a dozen jobs in Atlanta GA and I decide, at run time, that I don't want to see them. How do I set my DataView...
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 ...
8
by: Scott Emick | last post by:
I am using the following to compute distances between two lat/long coordinates for a store locator - (VB .NET 2003) it seems to take a long time to iterate through like 100-150 locations -...
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...
3
by: =?Utf-8?B?cG1jZ3VpcmU=?= | last post by:
I have a dataset with 3 tables -- 2 Parent tables and 1 table that is a child table of both the parents. I create a dataview on the child table and set the rowfilter to a value which filters the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.