Datagrid save generates "Bad request - error in query syntax" RRS feed

  • Question

  • I have a form containing a data grid. I need to have my user modify some data directly in the grid.

    When I try to save my changes (update, insert or delete), I get an error "Bad Request - Error in qiery syntax".  I haven't modify the event code in the data layer.

    How can I diagnose the exact cause? How can I fix the problem?

    I am using vs2012 Update 2

    Tuesday, May 14, 2013 3:05 PM


All replies

  • Ragoran, can you check out this blog - Diagnosing Problems in LightSwitch - it should walk you through on adding some error logging to your LightSwitch App to help diagnose what is happening here.

    Thx - Matt S

    R. Matt Sampson

    Tuesday, May 14, 2013 3:49 PM
  • Matt

    This article describe error in a deployed application. I've already used it to diagnose a deployment problem on a previous application.

    The application I am working on is still running in debug mode, directly from Visual Studio. The error message is displayed in a message box. It does not make the application crash, just refuses to make the update.

    I am running using my account. I am dbo on the database.

    Tuesday, May 14, 2013 5:15 PM
  • Found something interesting.

    I have this problem in 3 screens. The common element is that they contain a combobox with the list of user (domain\username) that is updated. If I select the value "testuser", it works. If I select a real value (with a domain and a \), it generates an error. Apparently, the \ is causing the problem...

    Tuesday, May 14, 2013 5:27 PM
  • Excellent - well I think I know what it is then:

    Backslash in query expression in LS2 with oData

    Does this sound like your issue?

    R. Matt Sampson

    • Marked as answer by Ragoran Thursday, May 16, 2013 8:52 PM
    Tuesday, May 14, 2013 5:31 PM
  • Matt

    I changed the value used as the key (removed the domain name as this is an intranet application) and everything is now working perfectly. Seems reasonable to assume that I stumble on the same bug.

    Thanks for your help.

    Thursday, May 16, 2013 8:53 PM