Question Cannot use 'Like' condition in dataset designer with MySql db

gate7cy

Well-known member
Joined
May 11, 2009
Messages
119
Programming Experience
3-5
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:

VB.NET:
Expand Collapse Copy
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?
 
Back
Top