Well, I’d go with:
Dim cmd as New SqlCommand(
"SELECT * FROM compliance_corner"_
+ " WHERE (body LIKE @query )"_
+ " OR (title LIKE @query)")
cmd.Parameters.Add("@query", "%" +searchString +"%")
More Related Contents:
- Preventing SQL Injection in ASP.Net
- What is the best way to read/parse the XML files [closed]
- Generating an Excel file in ASP.NET [closed]
- Are Parameters really enough to prevent Sql injections?
- An attempt to attach an auto-named database for file ….database1.mdf failed
- Is there a way to programmatically determine if a font file has a specific Unicode Glyph?
- The transaction manager has disabled its support for remote/network transactions
- How can I JSON encode an array in VB.NET?
- Images in database vs file system
- EF 4.1 exception “The provider did not return a ProviderManifestToken string”
- Stopping onclick from firing when onclientclick is false?
- How to configure SMTP settings in web.config
- IFrame: This content cannot be displayed in a frame
- Conversion from type ‘DBNull’ to type ‘String’ is not valid
- Editing Web.config programmatically
- URL Routing, Image Handler & “A potentially dangerous Request.Path value”
- Windows 7 Could not create SSL/TLS secure channel.”} System.Net.WebException
- What content type to force download of text response?
- How do I give ASP.NET permission to write to a folder in Windows 7?
- CustomErrors does not work when setting redirectMode=”ResponseRewrite”
- Best way to implement a 404 in ASP.NET
- “The system cannot find the file specified”
- How to decode viewstate
- ASP.NET 2.5 prefixing ctl00 and ASP.NET 4 not prefixing ctl00
- How do I attach the debugger to IIS instead of ASP.NET Development Server?
- Session would not retain values and always return null
- Cache VS Session VS cookies?
- What is an HttpHandler in ASP.NET
- Asp.Net MVC3, returning success JsonResult
- Default redirect for Error 404