In a C# Windows program, I want to update a Int field in a SQL Server table
int NewSeqno = MySeqno; // get current sequence number
NewSeqno++; // increment it
connection.Open();
// The following errors out saying that NewSeqno is not a column in the table.
// I want to update the field with the local variable NewSeqno.
command.CommandText = "UPDATE dbo.params SET NextSeqno = NewSeqno";
int recordsAffected = command.ExecuteNonQuery();
// The following statement, which writes a constant in the field, works fine.
command.CommandText = "UPDATE dbo.params SET NextSeqno = 123";