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

Spatial query error: "The query does not accept parameters, but valid params were passed for query"

1 Answer 80 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.
Ryan
Top achievements
Rank 2
Ryan asked on 05 Mar 2014, 09:40 AM
Hi. The following linq query fails with an OpenAccess error that I don't understand. I'm using SQL Server 2012 and the latest version of Data Access.
The variables s.geom and myGeomPoint in the below query are SQL geometry types.

var myList = (from s in db.Suburbs where (bool)s.geom.STIntersects(myGeomPoint) select s.SuburbName).ToList();

The error is: "The query does not accept parameters, but valid params were passed for query excecution"

Stack trace:
   at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
   at OpenAccessRuntime.ExceptionWrapper.Throw()
   at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.fetchNextQueryResult(ApplicationContext context, RunningQuery runningQuery, Int32 skipAmount)
   at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.getNextQueryResult(QueryResultWrapper aQrs, Int32 skipAmount)
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.Initialize()
   at OpenAccessRuntime.DataObjects.ForwardQueryResult.get_Item(Int32 indexParam)
   at OpenAccessRuntime.ListEnumerator.setCurrent(Int32 _pos)
   at OpenAccessRuntime.ListEnumerator.Move(Int32 relative)
   at OpenAccessRuntime.ListEnumerator.MoveNext()
   at Telerik.OpenAccess.Query.TypedEnumerator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at halfmouse.UrbanNexus.Web.Secure.RouteToWork.RadAjaxManager1_AjaxRequest(Object sender, AjaxRequestEventArgs e) in c:\WIP\Carpool\halfmouse.UrbanNexus\halfmouse.UrbanNexus.Web\Secure\RouteToWork.aspx.cs:line 70
   at Telerik.Web.UI.RadAjaxControl.OnAjaxRequest(AjaxRequestEventArgs args)
   at Telerik.Web.UI.RadAjaxControl.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

1 Answer, 1 is accepted

Sort by
0
Accepted
Ady
Telerik team
answered on 10 Mar 2014, 12:16 PM
Hello Ryan,

Should we continue the resolution to this problem via ticket '795221' ? This would help in maintaining a single point of reference. Maybe you can close this ticket.

Regards,
Ady
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
Ryan
Top achievements
Rank 2
Answers by
Ady
Telerik team
Share this question
or