Escaping values in SQL queries (C# with SQL connector)

前端 未结 5 1820
囚心锁ツ
囚心锁ツ 2020-12-11 16:39

I know I can use the parameters, but what is the right way to escape string sequences? The query could be like this:

\"INSERT INTO records (ReferenceID,Name,         


        
5条回答
  •  一向
    一向 (楼主)
    2020-12-11 17:42

    use commnd parameters instead. It takes care of escaping itself. It's the solution also against sql injections.

提交回复
热议问题