D
David Young
Hey folks, having a bit of a problem here and probably just need another
set of eyes to look at it.
I have an existing dataset, for the sake of this discussion, I'll call it
myDataSet. Please review the following:
[code snippit] ( C# )
string planType = this.ux_planType.SelectedValue;
string dedcd = this.ux_deductionCode.Text.Trim().ToUpper();
DataView dv = new DataView(myDataSet.myTable);
dv.RowFilter = "PLAN_TYPE = '" + planType + "' AND DEDCD = '" + dedcd + "'";
if(dv.Table.Rows.Count == 0)
{
// do some work here
return;
}
The problem is, the inner program loop never runs, becuase the
dv.Table.Rows.Count always returns > 0. I set a break point for the
debugger and stepped throught it. When I do, I can look at the Rows in the
DataView, but none of the match my RowFilter criteria that I set above. I
even put a debug message to write out the dv.Table.Rows.Count to the output
window before and after setting the RowFilter property, but the count
doesnt' change after applying the RowFilter.
Can anyone see why the RowFilter is not working?
set of eyes to look at it.
I have an existing dataset, for the sake of this discussion, I'll call it
myDataSet. Please review the following:
[code snippit] ( C# )
string planType = this.ux_planType.SelectedValue;
string dedcd = this.ux_deductionCode.Text.Trim().ToUpper();
DataView dv = new DataView(myDataSet.myTable);
dv.RowFilter = "PLAN_TYPE = '" + planType + "' AND DEDCD = '" + dedcd + "'";
if(dv.Table.Rows.Count == 0)
{
// do some work here
return;
}
The problem is, the inner program loop never runs, becuase the
dv.Table.Rows.Count always returns > 0. I set a break point for the
debugger and stepped throught it. When I do, I can look at the Rows in the
DataView, but none of the match my RowFilter criteria that I set above. I
even put a debug message to write out the dv.Table.Rows.Count to the output
window before and after setting the RowFilter property, but the count
doesnt' change after applying the RowFilter.
Can anyone see why the RowFilter is not working?