问题
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?
回答1:
String value = "Rubens' Home"; // value you want to sanitize and search
dt.Select(String.Format(
"Location = '{0}'", value.Replace("'", "''")));
来源:https://stackoverflow.com/questions/4906384/how-do-i-include-an-apostrophe-in-the-string-passed-to-datatable-select