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

RE: DataSet Filter by Jon

Jon
Wed Mar 09 07:29:02 CST 2005

Hello again!

I've seen the error of my ways!

Should be dv.Count!.

Thanks everyone,

Jon

"Jon" wrote:

> 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

RE: DataSet Filter by aconrad

aconrad
Thu Mar 10 19:23:49 CST 2005

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