checking NULL value in where clause fails with new version of ORM

2 posts, 0 answers
  1. FISCAL
    FISCAL avatar
    91 posts
    Member since:
    May 2010

    Posted 04 Jul 2011 Link to this post

    Hi,

    With the latest version of Open Access [2011.1.411.2], following LINQ query fails which was working fine with the older version

    LINQ query:

     int transactionCount = (from process in m_dataContext.DPFInvoiceData
                                        //where process.Processed == null || process.Processed == false //NULL condition is failing in this new version
                                        select process.DPFInvoiceDataID).ToList().Count();

    Stack Trace:

    Error executing query: Telerik.OpenAccess.RT.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute() SQL: SELECT a.[DPFInvoiceDataID] AS COL1 FROM [DPFInvoiceData] a WHERE (CASE WHEN a.[Processed] <> 0 THEN 1 ELSE 0 END) = (CASE WHEN NULL THEN 1 ELSE 0 END) OR (CASE WHEN a.[Processed] <> 0 THEN 1 ELSE 0 END) = 0 Telerik.OpenAccess.RT.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery() at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery() at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()


    Could you please let me know how to resolve it?

    Many thanks.

    MG
  2. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 08 Jul 2011 Link to this post

    Hello Milan,

    sorry for the inconvenience, we already fixed the issue. The upcoming 2011Q2 release will have the needed bits for that. 

    All the best,
    Thomas
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
Back to Top