C#C
C#13mo ago
Hazzza

SQL gives Missing operator error

SQL:
C#
"SELECT * " +
"FROM IngredientRecipe " +
"INNER JOIN Product ON IngredientRecipe.ProductName = Product.ProductName " +
"INNER JOIN Recipe ON IngredientRecipe.ProductName = Recipe.ProductName " +
$"WHERE IngredientRecipe.ProductName IN ({RecipeString}) AND IngredientName IN ({IngredientsString})";


My old SQL does work with only 1 other table being join on

Old SQL:
C#
"SELECT * " +
"FROM IngredientRecipe " +
"INNER JOIN Product ON IngredientRecipe.ProductName = Product.ProductName " +
$"WHERE IngredientRecipe.ProductName IN ({RecipeString}) AND IngredientName IN ({IngredientsString})";


I also tried with just the Recipe table being joined on and that also worked so seems to only happen when both tables are being joined.

(Im using OleDb .Net Framework)
image.png
Was this page helpful?