473,785 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

I am trying to code for a compound conditional in the DataView.RowFil ter 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.tax Batch);
dv.RowFilter = "BatchID = " + batchid + " && Segment = " + segment;
string agencyid = dv[0]["AgencyID"].ToString();
Nov 15 '05 #1
2 3964
Top Gun wrote:
I am trying to code for a compound conditional in the
DataView.RowFil ter 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.tax Batch);
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.Expr ession help topic:

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

Hope this helps
Jay

"Top Gun" <nf*@nospam.com > wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I am trying to code for a compound conditional in the DataView.RowFil ter 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.tax Batch);
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
3231
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 my code behind. when running the web form, the character which is entered directly to the web form during design time is displayed correctly, while those set from code behind appear as funny character
2
5989
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 'A' to 'J') "
3
341
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... DataView dv = new DataView(myTable, "field1 like '" + buffer + "*' and field2 = true", "field1", DataViewRowState.CurrentRows); The above doesn't seem to work. I'm not sure if I'm supposed to use the "and" in it...also I'm not sure how to do the...
1
2113
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 there any way to get the Dataview to keep track of the different RowFilter used?
3
3011
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 to filter them out? I tried but I don't understand the DataView.FilterState member function. Can someone give me an example that works with a Datagrid and data set instead of a console mode program? Thanks, Siegfried
8
4784
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 dv.RowFilter = "MTX <> 'Actual vs. Forcast'"
8
3271
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 - about 10-15 seconds...I want to make the code faster. I changed it to be multi-threaded, and it doesn't really make it any faster. The bottleneck seems to be with the math computations. Any ideas like changing my data types or other ideas etc would...
7
10211
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 a subset from the orders table, I need to take the customer ids in the orders table subset, and list each record in the customer table that has a matching customer id. If I were in t-sql, this would be an easy inner join. In this case, I get
3
5395
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 child based on values in both parent tables. When I edit the parent tables the edit is not reflected in the dataview.count property. How can I force the dataview to refresh following parent table edits? For example: Parent1
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8974
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.