I am having some issues while using the TableAdapter and the LIKE Statement in VB 2008. I am wanting to search name using partial spellings. When I run the application nothing is returned.
Here is my SQL:
SELECT MEMBERS.RolodexID, MEMBERS.FirstName, MEMBERS.LastName, MEMBERS.address, MEMBERS.Address2, MEMBERS.City, MEMBERS.State,
MEMBERS.Zip, MEMBERS.AreaCode1, MEMBERS.LocalNumber1, MEMBERS.AreaCode2, MEMBERS.LocalNumber2, MEMBERS.AreaCode3,
MEMBERS.LocalNumber3, Member_Employers.Department, Member_Employers.Job_Class, EMPLOYER.NAME, MEMBERS.Industry,
EMPLOYER.CODE
FROM EMPLOYER INNER JOIN
Member_Employers ON EMPLOYER.CODE = Member_Employers.Employer_Code INNER JOIN
MEMBERS AS MEMBERS ON Member_Employers.Rolodexid = MEMBERS.RolodexID
WHERE (MEMBERS.LastName like ?)
Here is my VB code:
DIM LastName as String
LastName = me.txt_LastName.text
Me.MEMBERSTableAdapter.FillBy(DataSet1.MEMBERS, LastName)
I've tried a couple of other codes including:
LastName = "'" & me.txt_LastName.text & "%'"
or
LastName = me.txt_LastName.text & "%"
Please Help!