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("'", "''")));
精彩评论