Incorrect syntax near ''. Unclosed quotation mark after the character string ' '

前端 未结 6 600
说谎
说谎 2021-01-24 00:11

I\'m just wondering if someone could point me in the right direction here, I think i\'ve been looking at it for too long so can\'t see the mistake.

The following code:

6条回答
  •  天涯浪人
    2021-01-24 00:37

    [textColour] = '" + txtColour + "WH
    

    Missing a single quote:

    [textColour] = '" + txtColour + "'WH
    

    EDIT: While I simply pointed out why the error was happening, the poster below me is correct about using parametrized queries for these sorts of things; or perhaps an ORM such as LINQ

提交回复
热议问题