Reputation: 33
I'm running the following statement:
SELECT product_naam, omschrijving
FROM product
WHERE (product_naam LIKE '*' + ? + '*') OR (omschrijving LIKE '*' + ? + '*')
It runs fine in Microsoft Access, but when I run it in ASP.NET with a grid view output, it does not give me any output.
Upvotes: 1
Views: 73
Reputation: 2204
In ADO.NET %
is a wildcard corresponding to *
in MSAccess. Change your query like below and it should work:
SELECT product_naam, omschrijving
FROM product
WHERE (product_naam LIKE '%' + ? + '%') OR (omschrijving LIKE '%' + ? + '%')
More details here
Upvotes: 1
Reputation:
try changing the wild cards from * to %
SELECT product_naam, omschrijving
FROM product
WHERE (product_naam LIKE '%' + ? + '%') OR (omschrijving LIKE '%' + ? + '%')
Upvotes: 0