I’ve got a Gridview connected to an sqldatasource connected to sqlserver, I have added the Select statement to be this, and it works like i want it.
SELECT S.[ID], S.[Survey_Name], S.[Start_Date], S.[End_Date], C.[Category_Name], S.[Username], S.[Picture],S.[Audience] FROM [Survey] S
Inner Join
Category C On S.Category_ID = C.ID
I now need to add an Update statement to just update the fields above when the user tries to edit the gridview, I tried this:
UPDATE
Survey S
INNER JOIN
Category C
On S.Category_ID = C.ID
SET
S.Survey_Name=@Survey_Name,
S.Start_Date=@Start_Date,
S.End_Date = @End_Date,
C.Category_Name =@Category_Name,
S.Username = @Username,
S.Audience=@Audience
Where
ID=@ID
But it just wont work, and keeps giving me errors like Invalid syntax “S”, or Invalid Syntax “Inner”…
Your update statement is incorrect:
EDIT