I think the problem with this statement is that you have a SELECT 1
in your sql statement, when it's not a column name in your table, and also the ,
in between the INSERT
and SELECT
statements as other people on here have mentioned.
I'm not entirely sure about the purpose of your IntImageID
variable in this context, but I'm guessing that you're trying to do one of two things.
1: You're trying to get the ImageID from the table, which is a column, in which case, you'd be wanting something like:
PropInsert = "INSERT INTO Image_has_Props (Image_ImageID, Props_PropID)
SELECT ImageID, PropID FROM Props
WHERE PropDescription = '"+StrPropDescription+"'";
OR
2: You're trying to put IntImageID
as the first insert value, and the second value is pulled from the database, in which case, it'd be something like the following:
PropInsert = "INSERT INTO Image_has_Props (Image_ImageID, Props_PropID)
("+IntImageID+", SELECT ImageID, PropID FROM Props
WHERE PropDescription = '"+StrPropDescription+"')";
I'm not really entirely sure if I wrote the second one correctly since I can't test it, but basically, it involves having your IntImageID variable separate from your SELECT statement, if it's not in the database table.