Setting value of parameter containing “ ' ” (apostrophe) used in LIKE query

前端 未结 3 1000
盖世英雄少女心
盖世英雄少女心 2021-01-22 02:04

I have the following query in ASP.NET/C# code which is failing to return any values using a parameter...

select * from MyTable where MyTable.name LIKE @search
         


        
3条回答
  •  悲&欢浪女
    2021-01-22 03:01

    within t-sql you escape ' by using two: ''

    @query=' this doesn''t cause a problem'

提交回复
热议问题