Hi Guys,
Again another quickie as I am struggling to find what is wrong with my code and if I am using this bitmask stuff properly. I need to select rows which bit 0 and bit 1 set in column: Cop_checkoptions. I have 2 rows that satisy this requirement but I only get the first row that satisfies this requirement. The code I use to generate the filter is as follows, is this correct? Interestingly on an update of rows I use this code with no problems... and I have checked the column values visually so I am pretty sure its not me being stupid! (ahem)
for(int i=0; i < 32; i++) {
uint bit = (uint)System.Math.Pow(2, i);
if ((bit & CheckedOptions) > 0) {
filter.Add(new FieldCompareExpressionPredicate(
CustomerOptionFields.Cop_checkoptions, ComparisonOperator.Equal,
new Expression(CustomerOptionFields.Cop_checkoptions, ExOp.BitwiseAnd, (bit & (uint)0x7FFF))));
}
}
Many thanks
Richard