Link to home
Start Free TrialLog in
Avatar of Prysson
Prysson

asked on

c# RowFilter > or < with decimal columns

How would I filter a dataview on a deimcal column using >  or < value..

For example I have a decimal d variable whose value is 100.1   I have a column called "size"

I want the row filter to filter so that only rows where the "size  is greater than the d (100.1)

My current filter

dv.RowFilter = "size = '" + d.ToString() + "'";

does not work...
ASKER CERTIFIED SOLUTION
Avatar of Jammer59
Jammer59
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Guy Hengel [angelIII / a3]
well, greater would need to  be >= and not =  ???
You stated you wanted "I want the row filter to filter so that only rows where the "size  is greater than the d (100.1)".  That is why I used only the greater sign.
If you want greater than or equal to use:
dv.RowFilter = "size > " + d.ToString();
 


 
Avatar of Prysson
Prysson

ASKER

Much thank..nk in my code I was using the appropriate greater sign..just a mistype in the coe when I wrote up the question..removing the single quotes did the trick.