This is a migrated thread and some comments may be shown as answers.

OpenAccessLinqDataSource bitwise where clause

1 Answer 53 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tom
Top achievements
Rank 1
Tom asked on 05 Jun 2014, 03:51 PM
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.

Thanks

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 09 Jun 2014, 08:36 AM
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. 

Regards,
Boyan
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
LINQ (LINQ specific questions)
Asked by
Tom
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or