locked
error passing the query RRS feed

  • Question

  • User1519602350 posted

    Kindly help me with the below error.

    Server Error in '/' Application.


    There was an error parsing the query. [ Token line number = 1,Token line offset = 27,Token in error = Order ]

    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: System.Data.SqlServerCe.SqlCeException: There was an error parsing the query. [ Token line number = 1,Token line offset = 27,Token in error = Order ]

    Source Error:

    Line 7:      var commandText = "UPDATE HomePageBanner SET Order = @0 WHERE Id = @1";
    Line 8:      foreach (var menuItemId in menuItemIds.Split(new[] { ',' })) {
    Line 9:          db.Execute(commandText, displayOrder, menuItemId);
    Line 10:         displayOrder ++;
    Line 11:     }


    Source File: c:\My Web Sites\WebPagesCMS(7) - pharma\Admin\Ajax\UpdateHomePageSliderItemOrder.cshtml    Line: 9

    Tuesday, October 7, 2014 7:16 AM

Answers

  • User527778624 posted

    Hi,

    I think, Order field need to be escaped, try updating like this:

    SET [Order] = @0

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 7, 2014 7:25 AM