Link to home
Create AccountLog in
Avatar of ajay1feb
ajay1feb

asked on

row filter with string value

where i am doing wrong in follwoing code?

 strProductLine = drow["ProductLine"].ToString();
            DataView dvProductLine = new DataView();
            dvProductLine = new DataView(dtAllProduct);
            dvProductLine.RowFilter = strProductLine;
ASKER CERTIFIED SOLUTION
Avatar of SteveH_UK
SteveH_UK
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Assumin the column name is "ProductLine" and it is a string field.

strProductLine = drow["ProductLine"].ToString();
            DataView dvProductLine = new DataView();
            dvProductLine = new DataView(dtAllProduct);
            dvProductLine.RowFilter = string.Concat("ProductLine = '", strProductLine, "'");
jandromeda: your solution is the same as what I had already offerred.
Yeah. I just wanted to show your solution in his example. :)
Thanks for the points :)