Saturday, February 25, 2012

query builder: how to do a LIKE parameter

hi,

i can do

"select * from products where name = @.name" kind of statements in query builder

but

"select * from products where name LIKE @.name" dosen't work!"


any ideas? i'm using sql server express.

thanks

That statement should look like this:

"select *from productswhere nameLIKE'%' + @.name +'%'"

|||

thanks!! it worked.

just wondering, if i have been using query builder and sql statements to construct tableadapters, would the application be vulnerable to sql injection attacks like classic asp?

|||Yes. Refer toHow To: Protect From SQL Injection in ASP.NET for details.

No comments:

Post a Comment