Same as what Gary said. Basically if the rainbowfish has been in an aquarium that has had any fish, plant, shrimp, snail, ornament or even water or gravel from a fish farm or pet shop, there's a chance the rainbowfish will have Fish TB (Mycobacteria). This is due to the Mycobacteria being able to survive in the aquarium for years and not dying from lack of a host, chlorinated tap water, standard aquarium medications, or even drying out for a few months.
Wild caught fish put into clean tanks with clean substrate, filters, heaters, plants, etc, are probably free of the disease. However, if you contaminate the tank with plants, gravel cleaner or anything else, you will eventually lose the fish to it.
Most people that keep rainbowfish try not to think about it and just remove the bodies when they bloat up or die.
Some people get eggs instead of fish and they hatch the eggs in a clean container of dechlorinated tap water. As soon as the fry swim around the surface, they scoop them out with a spoon and move them into a clean rearing tank. This can sometimes give you clean disease free fish but the Mycobacteria have been found on the outside of fish eggs so it's not 100% guaranteed. But it's a good option and the easiest way to do this is to breed fish in tanks with artificial mops that don't touch the bottom. Pick the eggs off the mop each day and put the eggs into a clean bucket of water to hatch.
If you know someone who has had their rainbowfish for more than 3 years and haven't lost any to TB, then their fish are probably clean and you could get eggs from them.