In that case, perhaps you have made the same mistake as me. On my wireless router – a D-Link DIR-825 recently upgraded to DD-WRT from the stock firmware – I had inadvertently set the the WPA algorithm to ”TKIP” rather than the more commonly used ”AES”. The result was that my Ipad tried to connect, lost connection, tried to reconnect, lost connection etc.
Once I saw my mistake and changed the setting, the Ipad had no problem connecting. Perhaps this can help you as well?