What brand of router do you have? The Nintendo Wifi connection will only work with certain brands and models which are listed
Here.
If you're having trouble setting up the DSi's Wifi to begin with then this
guide is a handy step-by-step tutorial.
If you have one of those routers in the first link and it's not working it might be that your internet security is too high. I wouldn't reccomend lowering the security peronsally - although it is a quick solution. It might be an idea to buy a Nintendo WiFi adaptor USB, it worked for me - however it isn't compatible with Windows Vista or 7.
WiFi adaptor results on ebay (I'd only reccomend buying one of these if all else fails due to the price. They went out of production a while ago so the cost started to rise.)
I hope you manage to connect. :)