[Mono-list] (generic)DataTable SELECT logic
Jan van der watt
janvanderwatt at gmail.com
Wed Feb 10 06:51:39 EST 2010
Thanks - I'll log the incompatibility.
I am specifically not checking for null values - I actually want the NOT
FALSE ones (yes, currently there are none in the dataset, but in future
there may be some). Perhaps I should add a "ISNULL(IsDeletedColumn,False)"
to future-proof the code.
lookup_value_schema_table.Select("IsDeletedColumn<>False") also returns the
incorrect set on Mono.
It's just that the column MAY also contain NULL values (as it does) and this
is where things go wrong. Columns with NULL should not "equal" or be "not
equal" to anything as far as my understanding goes.
[I'll check, but I seem to recall that "IS LIKE" works, but "IS NOT LIKE" is
broken on DataTable, as in it throws an error]
Thanks for the prompt reply.
On 10 February 2010 22:36, Stifu <stifu at free.fr> wrote:
> It looks like a Mono bug (or incompatibility), could you file a bug report
> for it?
> By the way, could you try using another expression, such as "IS NULL" or
> NOT NULL"?
> That's what Microsoft recommends, too:
> "You can check for null values using the "is null" and "is not null"
> jan van der watt wrote:
> > Hi,
> > Please let me know if this should be posted to another forum.
> > Has anyone else seen that the DataTable.Select(filterExpression) produces
> > a
> > funny when evaluating an expression that involves NULL, or is it just my
> > data/code gone wrong?
> > My code snippet is this:
> > DataTable lookup_value_schema_table = <an appropriate table>;
> > lookup_value_schema_table.Select("IsDeletedColumn<>0")
> > The dataset has either NULL or True in that column (but not False).
> > On MS .NET, only the rows with "True" are returned, but on Mono, ALL rows
> > are returned. It seems that the expression "NULL<>0" is FALSE on MS .NET,
> > but TRUE on Mono.
> > If I use:
> > lookup_value_schema_table.Select("IsDeletedColumn=True")
> > the results are as expected (i.e. only the rows with "True" in the column
> > are returned)
> > Thanks
> > Jan
> > _______________________________________________
> > Mono-list maillist - Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> View this message in context:
> Sent from the Mono - General mailing list archive at Nabble.com.
> Mono-list maillist - Mono-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list