I'm using a TableAdapter for the first time and adding a custom query to it, and I'm getting stuck on adding some search parameters to my query, here's what I've got:
SELECT *
FROM Orders
WHERE (id_order = @id_order) OR
(IsFor LIKE '%@word1%') OR
(IsFor LIKE '%@word2%') OR
(IsFrom LIKE '%@word1%') OR
(IsFrom LIKE '%@word2%')
When I test execute the query, I'm prompted for id_order, but not word1 or word2. I also tried adding these directly as parameters to the adapter and pass them in but they don't work. Strangely, id_order continues to work, but the other values don't generate any matches.
My goal is to allow the user to type in first &/or last name and have it match any orders with that first &/or last name.
Any ideas as to what I'm doing wrong?