DataSet Filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all.

I'm trying to filter a dataset using the below snippet, however, it's
returning 2 rows and it should only return 1. Can anyone please hel?p

DataView dv = new Customer().GetCustomerFiles(4).Tables[0].DefaultView;
dv.RowFilter = "FileType = 'Company Info'";

int b = dv.Table.Rows.Count;
string a = dv.Table.Rows[0]["Title"].ToString();

Thanks all,

Jon
 
Hello again!

I've seen the error of my ways!

Should be dv.Count!.

Thanks everyone,

Jon
 
You are getting the count from the DataTable, not the Rows collection in
the View.
Andrew Conrad
Microsoft Corporation.
 
Back
Top