ADO.NET Expressions fall short

B

Bob L.

Hi everyone,

A part of our system deals with using DataViews, and it appears that the
RowFilter property (DataColumn.Expression syntax) does not support the
following:

1) Bitwise operators
2) Integer division
3) Rounding

My real issue is that I need to filter based on check one or more bits in an
integer field. Failing to find support for that, I looked to solve it using
integer division. Again being thwarted, I turned to some kind of rounding on
the floating point division. 0-for3.

Is Microsoft really that careless, or am I missing something (or both)?

Thanks,
Bob L.
 
S

Sahil Malik

I've answered this question before over here -
http://groups-beta.google.com/group..._doneTitle=Back+to+Search&&d#bd593be4c42e2c9e

In there I used a simple rounding mechanism to evaluate a 2 digit decimal
precision out of a decimal, but you can easily implement rounding. You can
then compare the rounded and the floating point value to check for validity
of the integer.

Now there are more than one ways to skin a cat, but if you must use
DataColumn, you can do the above, but seriously that is like a gynaecologist
mechanic, you're trying to fix a car from it's exhaust pipe frankly.

Now for your specific case, why can't you just inherit from a datatable and
create your very own "strongly typed datatable" and encapsulate this logic
in it? :)

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 

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

Top