By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,670 Members | 1,501 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,670 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.