OpenAccessLinqDataSource bitwise where clause

2 posts, 0 answers
  1. Tom
    Tom avatar
    10 posts
    Member since:
    May 2013

    Posted 05 Jun 2014 Link to this post

    How can add a bitwise check in the where clause of the OpenAccessLinqDataSource? I tried to do it in the onSelecting event with the following code:

    OpenAccessLinqDataSource1.Where = "((StatusCode & 4096) > 0)";

    I receive this error: "Operator '>' incompatible with operand types 'String' and 'Int32'"

    The Data Access release history has "Support for bitwise operators enhanced - Bitwise &, |, ^, ! operators are now supported in OpenAccess ORM LINQ statements." as of Q3 2012.

  2. Boyan
    Boyan avatar
    100 posts

    Posted 09 Jun 2014 Link to this post

    Hello Tom,

    Telerik Data Access supports bit-wise operations through LINQ but, due to a limitation, those operations are not supported through the OpenAccessLinqDataSource. In order to workaround this limitation, you need to perform the data retrieval, filtering and binding in the web form code using a Telerik Data Access context.

    You could find additional information on the best practices of working with Telerik Data Access context in Asp.Net applications in this documentation article. Additionally you may find samples demonstrating those best practices in our samples kit - please check out the the ASP.NET Category.

    Should you have any more question or need any further assistance, do not hesitate to contact us. 

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
  3. DevCraft banner
Back to Top