How to use parameter with LIKE in Sql Server Compact Edition

前端 未结 5 1415
后悔当初
后悔当初 2020-12-17 19:07

I\'m trying to parameterise a search query that uses the LIKE keyword with a wildcard. The original sql has dynamic sql like this:

\"AND JOB_POSTCODE LIKE \'         


        
5条回答
  •  太阳男子
    2020-12-17 19:43

    Please post your complete example (including the outer client code where you are assembling your call). Both your second and third options should work if you are passing the parameter correctly. Are you calling this in a stored procedure or inline parameterized SQL?

    I assume no SPs since I just see you are using CE...

    I think you need to add a length to your .Add call since it's an nvarchar.

提交回复
热议问题