H
Howard
How do I do this with parameterized query?
without parameterized query:
string search = "hello world search";
search = search.Replace(" ", " AND ");
SELECT * FROM TABLE1 WHERE TEXT LIKE '%' + @search + '%'
parameterized query:
SELECT * FROM TABLE1 WHERE TEXT LIKE '%' + @search + '%'
cmd.Parameters.Add("@search", SqlDbType.NVarChar).Value = search;
basically I am trying to perform a search where all the words in the
search string are present.
Howard
without parameterized query:
string search = "hello world search";
search = search.Replace(" ", " AND ");
SELECT * FROM TABLE1 WHERE TEXT LIKE '%' + @search + '%'
parameterized query:
SELECT * FROM TABLE1 WHERE TEXT LIKE '%' + @search + '%'
cmd.Parameters.Add("@search", SqlDbType.NVarChar).Value = search;
basically I am trying to perform a search where all the words in the
search string are present.
Howard