In my webservice I need to be able to pull from 3 different tables to get my search to work. I have an autocompleteextender control on one page that searches by a description, but instead of displaying the description, it should display all of the products that have the word or phrase entered.
Ex: I enter the word “here” and the autocompleteextender will show products that have the word “here” in their description.
The description of the product is in one table that gets linked to the product table by a table that holds ids for both the product and the description. Therefore, I need 3 tables to be linked. I’ve always had troubles when it came to joining multiple tables together, I was hoping someone could help?
Here is my statement:
"SELECT DISTINCT p.ProductID,
p.ProductName
FROM Product p
INNER JOIN Marketing m
ON p.ProductID = m.ProductID
JOIN Feature f
ON f.FeatureID = m.MarketingData
WHERE f.FeatureTitle LIKE '%" & prefixText & "%'
ORDER BY p.ProductName ASC"
It pulls a null value when I type it into SQL Server so obviously something is wrong here. 
If you want only the rows on products that have the given text on his matching featuretitle of the feature table you need to use INNER JOIN in order to supress all non necessary rows.
With this sentence you will only get the rows in products that have a matching description on feature table.
Added for clarification purposes:
If possible use a parametrized query passing the searched text as a parameter. This will avoid some possible errors with texts containing reserved SQL characters like ‘ or ,
Specify allways the kind of join you want, like INNER JOIN, etc…