【发布时间】:2011-10-12 22:33:57
【问题描述】:
我有一个字符串
good overview of ESP's in more detail than you probably need.
插入 SQL 表时出错。所以我想用像
这样的双撇号替换字符串中的撇号good overview of ESP''s in more detail than you probably need
如何在 c# 中进行操作?
【问题讨论】:
-
你应该使用你的数据库转义函数。如果你不这样做,你可能会让自己容易受到 SQL 注入的影响。 stackoverflow.com/questions/249567/…
-
或者,更好的是:参数化查询。