Most freshwater fish are not adapted to saltwater conditions and cannot effectively osmoregulate. In freshwater a fish is hypertonic to its environment, meaning the fish is "more salty" and water continually flows into the fishes body via osmosis. In saltwater a fish is hypotonic or "less salty" compared to its environment. This meas water continually flows out of the fish's body. Fish gills are adapted to handle either situation, but often times not both. A freshwater fish would quickly become dehydrated after being placed in saltwater.
To add to what’s already been said, the family Cichlidae holds many species of fish that can acclimate to a fully saltwater environment. An interesting tidbit is that the Salton Sea, a man-made lake that had many types of saltwater and some freshwater fish introduced to it, is now saltier than the ocean. As a result most of the fish that once thrived in this lake have been unable to cope with the now higher salt levels, including numerous saltwater fish species. Miraculously, the tilapia seems to be still thriving in this environment, and the tilapia is a freshwater fish.