[RESOLVED]error passing the query

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 SitesWebPagesCMS(7) – pharmaAdminAjaxUpdateHomePageSliderItemOrder.cshtml    Line:
9

Hi,

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

SET [Order] = @0

Leave a Reply