Mark said:
Hi Cor,
Thanks for the response.
The system I'm working on allows many levels of applying filter, sorting
and grouping. Only the very first level actually issues a query to the
database, and, as you said, LIKE is fully supported by the db manager.
After that, data is in DataTables, and the app will allow these to be
filtered, sorted and grouped, in a series of steps.
So once the query is issued, I am trying to use the DataView for
subsequent filtering and sorting levels. The app can always apply these
other levels in code (that is, make field comparisons for each row, and
manipulate the DataTable directly), but am trying to get as much mileage
out of the DataView capabilities as I can. Note that the app is a
reporting only beast, so updates are never done.
So please let me know if there is any way to get the DataView FilterRow
and Sort properties to more fully support LIKE, or to execute case
insensitive comparisons ... or, for that matter, comparisons with rounded
values, like:
Round(QuarterlySales, -3) > = 5000
(select only those sales people whose quarterly sales, rounded to the
nearest thousand dollars, is >= 5000
--Mark, with the DataView, you're going to have some problems b/c you've hit
the limitations in most of these cases. On a DataTable, there's a
CaseSensitive property that will allow for case sensitive/insensitive
comparisons. The closest I know of with Rounding is using Typecasting to
take of precision but that's probably not what you want. You can use a
dataSets extended properties to specify data much like the Tag property in
VB, so you could store what to do in there and reference it, but as far as
filtering on it or sorting it, I don't think that's going to happen.
However, one thing you can do is to create your own class that inherits from
DataTable that has a Round function in it. You'd just create your own
method and roll it out like that. I did this before for some advanced
Statistical functions that weren't available out of the box. Since these
values are 'static' in the sense that your Round method will return the
rounded value, you should be able to use the Expression to filter on it. I
did this on aggregates for the dataTable and not the individual row, but I'm
99.9% sure you can do the same with a DataColumn. In short, what I'm saying
is that you can get where you want, but not directly. If this is stuff you
do a lot though, it might be worth creating a library for it, that's what I
did for the Stats stuff (for instance, I had a UpperControlLimit and
LowerControlLimit property, a RSquare and a few others that weren't
supported). It was a little bit of a pain but since I use them a lot, well
worth it.