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

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

    Posted 15 Dec 2014 Link to this post

    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

  2. Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 16 Dec 2014 Link to this post

    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.
     
  3. DevCraft banner
Back to Top