Does this code prevent SQL injection?

后端 未结 7 1212
無奈伤痛
無奈伤痛 2020-11-29 08:40

Background

I\'ve been contracted to analyze an existing Data Provider and I know the following code is faulty; but in order to point out how bad it is, I need to pr

7条回答
  •  借酒劲吻你
    2020-11-29 09:11

    I think it's safe (at least in SQL server), and I also think the only thing you actually need to do is s = s.Replace("'", "''"). Of course you should use parameterized queries, but you already know that.

提交回复
热议问题