First remove order by and limit from update query, There is nothing need of it and it never works also.
SqlConnection cn = new SqlConnection("ConnectionString");
string SqlQuery = "Update tableName set assignedtouserid='" + frmmain.UserName + "', flag=1 where flag=0 and city like '%" + newcituname + "%'";
SqlCommand cmd = new SqlCommand(SqlQuery, cn);
cn.Open();
cmd.ExecuteNonQuery();