dataview.rowfilter not working

G

Guest

i have this
DataView dv = new DataView(ds.tables[0]);
dv.RowFilter = "Carmake=" + strCars;
dg.datasource = dv;
dg.DataBind();

I get the error"
Can't find column [BMW]
BMW is the strCars value not the column name so why is this not working?
I have another form like this:
DataView dv = new DataView(ds.tables[0]);
dv.RowFilter = "Type= <> 'USED'";
dg.datasource = dv;
dg.DataBind();
and this works

I need the first one to be dynamic because I only want to show the car make
passed to the page and not all the cars
 

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