hi, I have a string named itemIDs separated by commas(12,43,34,..) and in order to use it as a parameter i need to convert it to int since the itemID in the db is in int format.
this is what i wrote but i get an error saying Incorrect syntax near the keyword 'as'.
using (SqlCommand searchResult = new SqlCommand("SELECT ItemID, Name, RelDate, Price, Status FROM item_k WHERE (itemID = cast(charindex(',',(@itemIDs as int))))", searchCon))
I cant figure it out, what seems to be the issue here?
thank you