My row has a NVARCHAR value in a certain column. I want to be able to concatenate onto this value eg, if the row stores “Hello,” I want to be able to run a db.Execute command to keep the “Hello” and tag on ” my name is Earl” so that “Hello, my name is Earl” is stored in the row.
What is the best practice for doing this?
db.Execute("UPDATE table SET description = description + '--@0 likes this' WHERE id = @1",user, id);
This doesnt accept the parameters and actually inserts @0and @1 into the database. Why is this ?
Just a guess, but try moving
@0out of the single quotes: