[RESOLVED]Token line number = 1,Token line offset = 35,Token in error = NewsText

I’m trying to edit my news pages:

Line 41:             var updateCommand = "UPDATE NewsItems SET NewsTitle=@0 NewsText=@1 WHERE ID=@2";
Line 42:             db.Execute(updateCommand, title, text, newskey);

Above you see NewsTitle and NewsText. If one or the other is removed editing in the remaining one can be carried out successfully. If the two are swapped around the error is with NewsTitle. There are no issues with adding or deleting items. There was a time
when all worked fine.

My knowledge if very limited and is mostly subjected to ‘cut & paste’. Can anyone help, please?

Separate the columns in the UPDATE command with commas.

var updateCommand = "UPDATE NewsItems SET NewsTitle=@0, NewsText=@1 WHERE ID=@2";

I thought the solution would be a simple one but that it was so simple! Thank you, thank you, thank you.

Leave a Reply