I am trying to show that if $L \to M$ is a complex line bundle endowed with a connection $\nabla$, $F$ is the curvature form, and $S \in M$ a closed surface, then $\int \limits _S F \in 2 \pi \textrm i \Bbb Z$. Alas, I am making some silly mistakes that give me $\int \limits _S F = 0$. (It is known that $\textrm d F = 0$.)
Method I
Let $D_3 \subset M$ be some 3-dimensional submanifold such that $S = \partial D_3$. Then $\int \limits _S F = \int \limits _{\partial D_3} F = \int \limits _{D_3} \textrm d F = \int \limits _{D_3} 0 = 0$.
Method II
Let $D_2 \subset S$ be a small closed disk such that it should be included in some domain of trivialization. Then $F = \textrm d A$ on $D_2$, for some $A$ (the local connection form). Let $C_2 = \overline {S \setminus D_2}$ and $c = \partial D_2 = - \partial C_2$. Then $\int \limits _S F = \int \limits _{D_2} F + \int \limits _{C_2} F = \int \limits _{D_2} \textrm d A + \int \limits _{C_2} \textrm d A = \int \limits _c A + \int \limits _{-c} A = 0$.
Where am I wrong? (What is amazing is that I seem to be able to make two different mistakes, one for each method!)
I) You can't find such $D_3$. You have correctly proved that if you can, the integral is zero. If you could find such a $D_3$, the surface would be null-homologous; but there are plenty of non-null surfaces (eg $\Bbb{CP}^1 \subset \Bbb{CP}^2$).
II) Your proof only works if $A$ is defined on both sides of the curve, so that $F=dA$ globally. But if this were true, then indeed the integral would be zero.