1. Have you checked the charger? Make sure the contacts on the side that slides into the DS aren't bent or broken. If this is an issue just replace the charger.
2. You may also need to replace the battery if the battery is not holding a charge.
And if those two things do not solve the issue:
3. It's fairly common over a period of time for the charging port inside the DS to become worn out. Get a flashlight and take a look at the charging port to see if anything looks bent or broken. If this is the issue you would need to bring it to one of those cell phone repair shops (I would call beforehand to make sure they work on handheld gaming systems) otherwise you might have to buy all the soldering equipment and parts and do the soldering job yourself.
Good Luck!