[Mono-list] (generic)DataTable SELECT logic
Veerapuram Varadhan
vvaradhan at novell.com
Fri Mar 5 08:35:51 EST 2010
Hi,
The Sql parser in Mono has some incompatibilities w.r.t auto-generated
expressions, which are currently being worked upon. Can you file a bug
with both the "IS NOT NULL" and this CONVERST expression? Also, please
provide corresponding MS.NET generated expressions, if possible, in the
bug, which would help in solving the issue.
Thanks,
V. Varadhan
On Tue, 2010-03-02 at 22:57 +1100, Jan van der watt wrote:
> Hi,
>
>
> On the topic of Microsoft's recommended expressions, it seems that
> Mono is still lacking some implementations, specifically CONVERT.
>
>
> In this code segment, an exception is thrown when the filter is used
> (spaces here and there for clarity):
>
>
> String source_filter = "
> CONVERT(wsUhBedOccupancy__dsUhBedOccupancy__vwBedOccupancy__strBedCode,'System.String') LIKE '%03cb%' ";
>
>
> foreach ( DataRow raw_result_row in
> intermediate_data_table.Select(source_filter) ) {
> ....
> }
>
>
> Exception:
> Expression
> 'CONVERT(wsUhBedOccupancy__dsUhBedOccupancy__vwBedOccupancy__strBedCode,'System.String') LIKE '%03cb%'' is invalid.
>
>
> Of course, some help on exactly WHAT is invalid would help resolve the
> problem.
>
>
> All the columns exist etc., and it does work on .NET.
> (and so does:
> " wsUhBedOccupancy__dsUhBedOccupancy__vwBedOccupancy__strBedCode LIKE
> '%03cb%' "
> )
>
>
> Before I log a bug for this, will you please be so kind and just check
> that I did not go and do something terribly stupid in the way I
> constructed the filter :-)
>
>
> Thanks!
>
>
> Jan
>
>
> 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 "IS
> NOT NULL"?
> That's what Microsoft recommends, too:
> http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression%28VS.85%29.aspx
> "You can check for null values using the "is null" and "is not
> null"
> expressions."
>
>
>
> 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: http://old.nabble.com/%28generic
> %29DataTable-SELECT-logic-tp27528859p27529788.html
> Sent from the Mono - General mailing list archive at
> Nabble.com.
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
> _______________________________________________
> Mono-list maillist - Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
More information about the Mono-list
mailing list