[SQL] Using 'Like' operator for prepared statement
-
Hi all, E.g "Select * from table_A where firstName Like '%" + string + "%'"; How to change the ad-hoc sql to prepared statement using operator 'like' and '%'? Thanks
-
Hi all, E.g "Select * from table_A where firstName Like '%" + string + "%'"; How to change the ad-hoc sql to prepared statement using operator 'like' and '%'? Thanks
How 'bout putting the wildcard character within the parameter?
string strName = "%john%"
string strSQL = "select * from table_A where firstName like ':PARAM'"Then assign to your parameter the value of strName. Chris Meech I am Canadian. [heard in a local bar] Gently arching his fishing rod back he moves the tip forward in a gentle arch releasing the line.... kersplunk [Doug Goulden] Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]