I recently found when I do a LINQ select under a field that contains an apostrophe, it makes my application to throw an exception.
DataRow[] newDr = this.ds.Tables["TableName"].Select("Name = '" + drData["Name"].ToString() + "'");
If drData["Name"] = "The business's money"
I got an exception of "Syntax error: Missing operand after 'S' operator "
Can anyone tell me how to preserve it and no replace it or remove it, please?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…