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

  • Thread starter Thread starter Top Gun
  • Start date Start date
T

Top Gun

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();
 
Top said:
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
 
Back
Top