Skip to content
Advertisement

System.Data.SqlClient.SqlException occured in System.Data.dll (incorrect syntax)

I can’t work out what the problem is here, since the additional information comes back as: Incorrect Syntax near ‘(‘. I think I need fresh eyes on this I can’t see the error.

Here is my code, im trying to update the information to the selected Owner_ID.

Advertisement

Answer

You used INSERT syntax instead of UPDATE syntax:


Or if you indeed wanted to insert a new record change UPDATE to INSERT INTO and remove the WHERE (but I guess the WHERE indicates that you wanted to update).

Btw: are you sure to update the OwnerID in the OwnerTable? Seems wrong to me.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement