Ax + By + C = 0 isn't the whole story.
A straight line in the plane has two degrees of freedom only, not three like your equation suggests. And this line has to go through point (1,2), so there can't be more than one degree of freedom (e.g. the slope).
You can eliminate one degree of freedom by requiring A2 + B2 = 1 (effectively dividing by ##\sqrt{A^2+B^2}## -- and no fear of dividing by zero; why not ?)
That means the new A and B can be written as ##\cos\phi## and ##\sin\phi## for some angle ##\phi## (well, not just 'some' angle...)
Congrats! you have just derived the so-called http://doubleroot.in/straight-line-normal-form/equation for a straight line !Not there yet: the line has to go through (1,2), so you now eliminate C by substituting the coordinates of point A.
According to your equation the new C ( let's call it C' ) is then the distance to the origin, so you have that in terms of xA and yA.
If you know about maximizing a function, you can differentiate that expression and thus find ##\phi##
If you know about vector products, you can also see that the left hand side is a dot product of two vectors: ##|C'| = (1,2)\;\cdot\; (\cos\phi, \sin\phi)## and the absolute value of that is $$|C'| = |(1,2)| \; |(\cos\phi, \sin\phi)| \; cos\alpha$$ where ##\alpha## is the angle between the two vectors.
And then |C'| is clearly maximum if ##\alpha = 0## (the two vectors are collinear).