DataView RowFilter

  • Thread starter Thread starter Ryan Moore
  • Start date Start date
R

Ryan Moore

I have a dataset (called adset) which has a column called "Large" which is
either an integer 0 or 1.

I am creating 2 dataviews, one which should display the 1's and one which
should display the 0's using the following code:

DataView largeview = new DataView();
largeview.RowFilter = "Large=1";
largeview.Table = adSet1.Tables[0];
DataView smallview = new DataView();
smallview.RowFilter = "Large=0";
smallview.Table = adSet1.Tables[0];

but, for some reason, adSet, largeview, and smallview all have 8 rows.....
what am I doing wrong?
thnx
 
try this..telling the dataview about the table you are using before the rowfilter

DataView largeview = new DataView(adSet1.Tables[0]);
largeview.RowFilter = "Large=1";

DataView smallview = new DataView(adSet1.Tables[0]);
smallview.RowFilter = "Large=0";
 
Still no-go


try this..telling the dataview about the table you are using before the
rowfilter

DataView largeview = new DataView(adSet1.Tables[0]);
largeview.RowFilter = "Large=1";

DataView smallview = new DataView(adSet1.Tables[0]);
smallview.RowFilter = "Large=0";
 

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

Back
Top