thanks i got the answer. the problem was that i couldnt get the difference b/w surface and line integral.in gauss theorem we consider a 2D surface around the conductor but in amperes theorem we consider a loop sorrounding the conductor.. for a solenoid if we consider a loop sorroundig it the net current through it is zero.. so field outside is zero. am i correct? fastplzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
also if we consider aloop inside the solenoid there is no current through it. but thre is field inside . why is it so?