Sometimes the infection is caused by a virus and sometimes by bacteria. Viral infections are not really preventable, but bacterial infections are.
Food poisoning is an example of a bacterial infection.
Bacteria can be picked up from many sources, including other people. Washing your hands frequently is one of the best methods of protection from a bacterial infection. When to Contact your Health Care Provider Nausea, vomiting, and diarrhea may or may not be due to gastroenteritis . If your symptoms are mild and have been present for less than 24 hours, try the advice below to relieve symptoms. If symptoms persist for more than 48 hours, or if any of the following occur, contact Health Services or your Health Care Provider.