I have the following piece of code
cmd.CommandText = "SELECT * FROM product WHERE name LIKE '%@pattern%' OR description LIKE '%@pattern%' OR category LIKE '%@pattern%';";
cmd.Parameters.AddWithValue("pattern", pattern);
This returns an empty resultset in my code.
But if I type the query in PgAdmin like this
SELECT *
FROM product
WHERE name LIKE '%otter%'
OR description LIKE '%otter%'
OR category LIKE '%otter%';
What am I doing wrong?