I have realised what was my problem. I simply misunderstood Ampere's law. You see Ampere's law is going to give a magnetic field associated to a current flowing in one wire. And in the solenoid, it is one wire! So it is nonsense to sum the same magnetic field many times over. Only when there are...
I'm a bit confused with the equation for a long solenoid. The usual derivation has us consider a rectangular loop enclosing N number of currents over the length L through it. So by Ampere's law one gets B=μNI/L.
The currents and the loop look like this right?
---------
| . . . . |...