It is impossible to connect to a Nintendo DS, I know this without trying because DSs aren't infra-red, they connect through wifi. I highly doubt that connecting with your remote control will get you anywhere either- it may even result in a glitchy tamagotchi! so I do not recommend anyone to try this.
... Won't work. Tamagotchi and TV remotes are programmed differently, to pick up different signals. So a TV remote won't pick up the signals from a Tamagotchi and vica versa.