2. When $x$ takes the values $\frac{1}{2007}, \frac{1}{2006}, \cdots, \frac{1}{2}, 1$, $2, \cdots, 2006, 2007$, calculate the value of the algebraic expression $\frac{1-x^{2}}{1+x^{2}}$, and add up the results obtained. The sum is equal to ( ).
(A) -1
(B) 1
(C) 0
(D) 2007
2.C.

Notice that
$$
\frac{1-\left(\frac{1}{n}\right)^{2}}{1+\left(\frac{1}{n}\right)^{2}}+\frac{1-n^{2}}{1+n^{2}}=\frac{n^{2}-1}{n^{2}+1}+\frac{1-n^{2}}{1+n^{2}}=0,
$$

that is, when $x$ takes the values $\frac{1}{n}$ and $n\left(n \in \mathbf{N}_{+}\right)$, the sum of the values of the algebraic expressions calculated is 0.
And when $x=1$, $\frac{1-1^{2}}{1+1^{2}}=0$.

Therefore, the sum of the values of all the algebraic expressions calculated is 0.