I've tried and tried and tried to change the gender, and how it was impossible! tell me how to please! (Um... I am NOT planning to debug my connexion if you ought to know.)
You cannot change the gender once you hatch your tamagotchi egg, if you would rather have one gender other that another, just keep reseting it until you get what you want, if u are that serious about it
Once your tama is born you cannot change it gender.
If you are using the matchmaker to breed your tamas, there is theory (though it's not fool proof) about pressing A as opposed to B when the match maker appears on the screen. One is supposed to give you a girl and one is supposed to give you a boy. It's a theory and as I said it's not fool proof cause there are always poeple who have experienced things differently. But it might be worth a try. It is meant to be a matter of chance... really I don't think it matters what the sex of your tama is unless you are trying to breed it with another tama.
Some people say it works, but others dnt like me....i think its just luck, i say that u should go with resetting your tamagotchi until u get one(u will lose the generation though if its on gen 2 or higher)