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

[Solved] Filter Error

7 Answers 166 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mark Sheldon
Top achievements
Rank 2
Mark Sheldon asked on 28 Mar 2010, 06:53 PM
Depending upon whether I have the Rad Grid's EnableLinqExpressions property set to true or false, on filtering using the built in column filter, OpenAccess is returning either of the following errors: This is for a RadGrid, "out of the box" bound to a declarative data source. It pulls up the data just fine, but errors out when filtering some of the columns.

When EnableLinqExpressions(true): Exception of type 'Telerik.OpenAccess.SPI.Util.QueryExceptionHelper' was thrown.

When: EnableLinqExpressions(false): line 1:97: expecting "left parenthesis", found 'LIKE' ("LIKE" is a reserved word.)
Original Query: DEFINE EXTENT xt FOR CE3k5._2DataTier.TrainingareaShopper; SELECT * FROM xt AS this WHERE (Last LIKE 'User*')


I assume that someone has run into this before. Can someone refer me to the solution?

RadControls v2010.1.309.35
OpenAccess v2010.1.312.2

TIA

m.

7 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 29 Mar 2010, 04:51 PM
Hi Mark,

I am afraid we are not able to reproduce this behavior. Could you please give us more details about the problem? It would be helpful to know what actions you performed to get the error - what is the type of the column that you are filtering on, the filter value and the filter type (Contains, StartsWith, etc.). A stack trace of the exception or a sample project producing it would be greatly appreciated as well.

Please note that the first exception - when EnableLinqExpressions is set to True, is expected. The value of this property should be set to False in order for datasource to work properly. However, we have not seen any problems in such cases. We are looking forward to resolving the problem.

Regards,
Serge
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mark Sheldon
Top achievements
Rank 2
answered on 29 Mar 2010, 08:59 PM
Hi Serge,

Thanks for your assistance.

The following is the error message and stack trace. The error is consistent for each applicable item in the list (Contains, Does Not Equal, etc), The field type is a nullable varchar with a Length of 50. Let me know if the stack trace is not helpful, and I'll extract the elements and send in a sample project.

Thanks again.

Error:

Server Error in '/ce3k51.2' Application.

line 1:97: expecting "left parenthesis", found 'LIKE' ("LIKE" is a reserved word.)
Original Query: DEFINE EXTENT xt FOR CE3k5._2DataTier.TrainingareaShopper; SELECT * FROM xt AS this WHERE (Last LIKE '*U*') ORDER BY this.Last DESC

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Telerik.OpenAccess.Exceptions.QueryException: line 1:97: expecting "left parenthesis", found 'LIKE' ("LIKE" is a reserved word.)
Original Query: DEFINE EXTENT xt FOR CE3k5._2DataTier.TrainingareaShopper; SELECT * FROM xt AS this WHERE (Last LIKE '*U*') ORDER BY this.Last DESC

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[QueryException: line 1:97: expecting "left parenthesis", found 'LIKE' ("LIKE" is a reserved word.)
Original Query: DEFINE EXTENT xt FOR CE3k5._2DataTier.TrainingareaShopper; SELECT * FROM xt AS this WHERE (Last LIKE '*U*') ORDER BY this.Last DESC]
   Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28
   Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +34
   OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.compileQuery(ImmutableQueryDetails query) +239
   OpenAccessRuntime.DataObjects.OpenAccessQueryImp.compile() +106
   Telerik.OpenAccess.RT.QueryImpl.Compile() +34
   Telerik.OpenAccess.RT.QueryImpl.Execute(Object[] args) +91
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteOqlQuery(IQuery oqlQuery, Object[] queryArguments, Int32 startRowIndex, Int32 maximumRows) +136
   Telerik.OpenAccess.RT.DataSource.OpenAccessDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1312
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   Telerik.Web.UI.GridTableView.PerformSelect() +28
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.GridTableView.DataBind() +350
   Telerik.Web.UI.GridTableView.Rebind() +98
   Telerik.Web.UI.GridFilterCommandEventArgs.ExecuteCommand(Object source) +1002
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +61
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   Telerik.Web.UI.GridItem.FireCommandEvent(String commandName, Object commandArgument) +80
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +8979
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016

0
Serge
Telerik team
answered on 30 Mar 2010, 05:12 PM
Hi Mark Sheldon,

 Unfortunately we are still unable to reproduce the behavior. Can you please send us a sample project so we can debug the reported exception. Maybe the difference is coming because of the type or version of your database server as well. We are looking forward on continuing the collaboration until we get to the bottom of this issue

All the best,
Serge
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mark Sheldon
Top achievements
Rank 2
answered on 31 Mar 2010, 02:40 PM
Thank you, Serge,

I have opened support ticket # 295830 and uploaded a sample project today.
0
gmendez
Top achievements
Rank 1
answered on 16 Dec 2010, 03:29 PM
Hello Serge,

I faced the same problem usin RadGridView and OpenAccesDataSource.
I was trying to play a bit with OpenAccess in web applications so I tryed this quickstart:

ms-help://telerik.openaccess.orm/telerik.openaccess.programmers/data-toolbox-controls-openaccessdatasource-example.html

When performing step 7 of tha task group "To bind the grid view control to the SalesOrderDetail data source" I made a mistake and selected Order instead of OrderId. At runtime I got an error stating: "...Order is a reserved word...".
In this case I was using Northwing database to follow the example. The classes were generated by openacces using the reverse mapping wizzard. As there's a table called Order, I got a class called Order too, thus, producing the runtime error.
What should be done in those cases?
Best wishes,

Gonzalo
0
Petko_I
Telerik team
answered on 21 Dec 2010, 08:43 PM
Hello gmendez,

We have already addressed the issue of handling reserved words in the OQL queries that the OpenAccessDataSource uses. The next distribution of OpenAccess should handle these scenarios correctly.
To tackle reserved words when applied to a filter in the OpenAccessDataSource, you can add the "this." word in front of the property name that is involved in the where clause. Have a look at the following example:
<telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"
            ObjectContextProvider="OADataSourceWebApplication.NorthwindEntityDiagrams, OADataSourceWebApplication"
            TypeName="OADataSourceWebApplication.Employee"
            Where="this.Like == @Like">
            <WhereParameters>
                <asp:ControlParameter ControlID="RadComboBox1" DefaultValue="London"
                    Name="Like" PropertyName="SelectedValue" />
            </WhereParameters>
        </telerik:OpenAccessDataSource>

Thus the OQL query correctly identifies the "Like" word as a property. We have identified the possible places where reserved words can mislead the OQL parser and from the next distribution of OpenAccess the process for using them should be smooth.

We do hope the information above was helpful. Do not hesitate to contact us, should you have other questions.

All the best,
Petko_I
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
0
gmendez
Top achievements
Rank 1
answered on 22 Dec 2010, 11:39 AM
Cool. Thanks a lot and merry christmas.
Tags
General Discussions
Asked by
Mark Sheldon
Top achievements
Rank 2
Answers by
Serge
Telerik team
Mark Sheldon
Top achievements
Rank 2
gmendez
Top achievements
Rank 1
Petko_I
Telerik team
Share this question
or