G
Guest
Hello All,
I am trying to filter rows in a datatable based on filtercriteria and
sortcriteria using the datatable.select() method.
I am encountering a strange behavior in this process. Here is what I am
trying to do...
---------
1. Queried a table based on a filtercriteria and retrieved 40 rows into a
table in a dataset. Now my dataset's 0th table has 40 rows.
2. Now trying to select rows in the 0th table of the above dataset using a
filtercriteria.
Technically speaking if I run a select method over a parent table, resulting
child table should have less number of rows than parent table ....right? How
come my step 2 is returning 43 rows?
All I can conclude is select method is filtering the rows from the original
database table and not on the step 1 dataset's 0th table. I am sure that I am
using the correct syntax....
---
int noRowsParentTable = objDataSet.Tables[0].Rows.Count;
foundRows = objDataSet.Tables[0].Select("ID < 4600");
int noRowsChildTable = foundRows.Length;
----
noRowsParentTable = 211 rows
noRowsChildTable = 1327 rows
Can anyone please correct me? Or explain the strange behavior?
TIA,
Diffi
I am trying to filter rows in a datatable based on filtercriteria and
sortcriteria using the datatable.select() method.
I am encountering a strange behavior in this process. Here is what I am
trying to do...
---------
1. Queried a table based on a filtercriteria and retrieved 40 rows into a
table in a dataset. Now my dataset's 0th table has 40 rows.
2. Now trying to select rows in the 0th table of the above dataset using a
filtercriteria.
Technically speaking if I run a select method over a parent table, resulting
child table should have less number of rows than parent table ....right? How
come my step 2 is returning 43 rows?
All I can conclude is select method is filtering the rows from the original
database table and not on the step 1 dataset's 0th table. I am sure that I am
using the correct syntax....
---
int noRowsParentTable = objDataSet.Tables[0].Rows.Count;
foundRows = objDataSet.Tables[0].Select("ID < 4600");
int noRowsChildTable = foundRows.Length;
----
noRowsParentTable = 211 rows
noRowsChildTable = 1327 rows
Can anyone please correct me? Or explain the strange behavior?
TIA,
Diffi