DafaultView traversing, C#

  • Thread starter Thread starter flemming eriksen
  • Start date Start date
F

flemming eriksen

Hi.

I have a DataSet with two tables, and I setup a view (using defaultView) on
one of the tables within the DataSet. All with strong typing.
Here the 3 lines:


ppDS.HPerson.DefaultView.RowFilter = "fullname like 'test%'";
int row_count = ppDS.HPerson.DefaultView.Count;

foreach (ParamPersonDataSet.HPersonRow dr in
ppDS.HPerson.DefaultView.Table.Rows)



The row_count gives me the correct result, but the traversing with foreach,
gives all rows, so

How should the line with foreach look?

Thanks, Flemming
 
sorry, found it:

foreach (DataRowView dr in ppDS.HPerson.DefaultView)

{

//ParamPersonDataSet.HPersonRow row = (ParamPersonDataSet.HPersonRow)
dr.Row;

string funame = ((ParamPersonDataSet.HPersonRow) dr.Row).FullName;
 
Back
Top