DataView RowFilter

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
 
R

Raterus

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";
 
R

Ryan Moore

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top