Last post Feb 06, 2010 10:50 AM by GuyCre8ive
Feb 06, 2010 10:38 AM|GuyCre8ive|LINK
I'm having problems getting my AutoCompleteExtender to work the way I want it to and was wondering if anyone can help. I'm using the following select statement and it works fine but I need it to AutoComplete the results that contain the term as well and
not just the results that start with the term. To clarify, if I type in "phrase" it won't AutoComplete the result "my phrase" but if I type in "my" it will. Anyone have a clue what I'm doing wrong? I've tried to use "contains @term" instead of "like @term" but
it doesn't work..
Dim cmd As New SqlCommand("SELECT DISTINCT TOP(@nrows) SearchTerms FROM tblTerms WHERE TermName like @term", cn)
Feb 06, 2010 10:44 AM|limno|LINK
Try to modify your WHERE clause to include wildcard before and after your searched term parameter:
WHERE TermName like '%' + @term + '%'
Feb 06, 2010 10:50 AM|GuyCre8ive|LINK
Beautiful, thank you so much..