Bizarre Escape Character Question

Posted by William Calleja on Stack Overflow See other posts from Stack Overflow or by William Calleja
Published on 2010-04-28T14:24:33Z Indexed on 2010/04/28 14:33 UTC
Read the original article Hit count: 259

I have the following c# code embedded in a literal <% %> of a c# asp.net page

string commandString = "SELECT tblData.Content " +
                        "FROM tblData " +
                        "WHERE (tblData.ref = N\'%"+myCurrentREF+"%\')";

This is breaking my code since it apparently cannot use the \' escape character. Why is it so? other escape characters like \" are working so why isn't \' working?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET