Okay, here you go:
Error Code: 51099
Most Likely Cause: 'It appears that the settings entered into the Nintendo DS are not compatible, or the router's broadcast settings should be changed.'
How to fix: 'Try creating a new connection with your system.'
If you need more help, go on to 'Google' and type up Nintendo Error Code 51099.
It should help.
Okay, nevermind. I found an old answer relating to this:
the question: my sister's heart gold game won't connect to wifi but my black game will why is this?
the answer was...
Heartgold and Soul Silver you still need the Nintendo WFC USB. you have to purchase it. Black and white you can just do it over
internet.
Kudos to LiooneTate