开发者

How do I include an apostrophe in the string passed to DataTable Select()?

The dt.开发者_开发问答Select(string) gives error missing operand when apostrophe symbol is in the string.

what is the way to solve this error? or How to handle this error?


String value = "Rubens' Home"; // value you want to sanitize and search
dt.Select(String.Format(
    "Location = '{0}'", value.Replace("'", "''")));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜