There are several reasons for this.
What type of DS was it? Some DS' are not compatible with certain access points and routers. If that is the case, there is virtually nothing you can do other than switch your router. 3DS should work for almost any point, but DS and DSi can be very picky with what routers you can use. Sorry
If the router is compatible, then instead of putting everything in, just search for a hotspot or whatever it was called. if it find the correct one, then it should change the settings automatically. If it isn't then you picked up someone elses broadband :}
[Check this website for help][1].
Hope I could help.
[1]: http://www.nintendo.com/consumer/systems/ds/#wfc