I am using visual studio 2008 and I am trying to create some queries in my designer to use in my form. The query I am trying to use is:
When I run this and whatever I enter for the parameter value I get zero results. When I dropped the parameter and enter the value/letter with the wildcard directly in the where clause I get the correct results.
The issue is that I have tried all different versions of the wildcard and how to use it but the only thing I get is syntax errors. I am using MySql V.5.0.45. The designer will not let me use a wildcard with the query. What is the correct syntax to use wildcard/parameter with VB.net and MySql?
VB.NET:
SELECT Address, Balance, Block, Code, CustName, CustomerID, Email, Fax, FlatNum, HouseNum, LastEditBy, Mobile, Nick, Other, OtherTel, PostCode, Street, Surname, Telephone, Town, UserID, Webpage
FROM customer
WHERE (Surname LIKE @Param2)
When I run this and whatever I enter for the parameter value I get zero results. When I dropped the parameter and enter the value/letter with the wildcard directly in the where clause I get the correct results.
The issue is that I have tried all different versions of the wildcard and how to use it but the only thing I get is syntax errors. I am using MySql V.5.0.45. The designer will not let me use a wildcard with the query. What is the correct syntax to use wildcard/parameter with VB.net and MySql?