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

ERR: The query does not accept parameters, but valid params were passed for query execution (Spatial)

1 Answer 132 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.
Matthew
Top achievements
Rank 1
Matthew asked on 15 Dec 2014, 06:41 AM
Having a frustrating time with a LINQ query used by order results by distance to a spatial point.
Any suggestions or ideas would be much appreciated.

This test query works.
SqlGeography point = SqlGeography.Point(QUERY_LAT, QUERY_LONG, 4326);
var query = (from q in Data.Model.Place_Addresses
            orderby q.PLACE_ADDRESS_LOCATION.STDistance(point)
            select q).Take(50);


Actual query with JOIN doesn't.
// Define base query.
var point = SqlGeography.Point(QUERY_LAT, QUERY_LONG, 4326);
var query = from q in Model.Place_Listings
            join pa in Model.Place_Addresses on q.PLACE_SEQ equals pa.PLACE_SEQ
            orderby pa.PLACE_ADDRESS_LOCATION.STDistance(point)
            select q;

Telerik.OpenAccess Error: 2 : The query does not accept parameters, but valid params were passed for query execution.
A first chance exception of type 'Telerik.OpenAccess.OpenAccessException' occurred in Telerik.OpenAccess.dll

1 Answer, 1 is accepted

Sort by
0
Viktor Zhivkov
Telerik team
answered on 16 Dec 2014, 12:33 PM
Hi Matthew,

I am sorry, but we were unable to reproduce the issue in our test environment.
Can you confirm that you are using Telerik Data Access version 2014.3.1027.1?
Also can you provide us with details about PLACE_SEQ property - is it a primary key for the entity type and what is the CLR type of the property?

If you are still experiencing the issue, please prepare a small sample console application that illustrates the problem and let us know, so we can arrange a way for you to send it over so we can analyze it and pin point the root cause.

Regards,
Viktor Zhivkov
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
Matthew
Top achievements
Rank 1
Answers by
Viktor Zhivkov
Telerik team
Share this question
or