DataSet Filter

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
 
G

Guest

Hello again!

I've seen the error of my ways!

Should be dv.Count!.

Thanks everyone,

Jon
 
A

Andrew Conrad

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top