The cause of stomach pain when eating may be physiological factors bad eating habits, may also be disease factors including chronic gastritis, peptic ulcer, etc., it is recommended to consult a doctor to clarify the cause of the disease, and then targeted treatment, such as changing dietary habits, taking omeprazole, thioglycollate and other drugs. 1. Bad dietary habits can lead to stomach pain when eating, such as often like to eat spicy, stimulating, cold and frozen food, the food on the gastric mucosa caused by stimulation, thus causing stomach pain when eating, by changing dietary habits, the symptoms will be improved. 2. Chronic gastritis caused by a stomach ache when eating is due to the presence of gastric mucosa inflammation, drug treatment commonly used esomeprazole magnesium enteric capsule, lansoprazole orally disintegrating tablets, aluminum thioglycollate, etc., pay attention to the esomeprazole magnesium enteric capsule can not be used in conjunction with nelfinavir, is taking human immunodeficiency virus protease inhibitor patients with the prohibition of lansoprazole orally disintegrating tablets, the emergence of allergic and other adverse reactions to stop the use of medication. 3. peptic ulcer main symptoms for the middle and upper abdominal pain, the treatment method first to take general treatment, such as avoiding excessive stress and exertion, avoid spicy and stimulating food, but not satiated, in order to prevent excessive dilation of the gastric sinus and increase the secretion of gastrin. Drug treatment ace omeprazole magnesium enteric capsules, lansoprazole orally disintegrating tablets are also applicable. The phenomenon of stomach pain when eating may also be caused by other reasons, first of all, you should consult a doctor in time to identify the cause, under the guidance of the doctor targeted treatment. Usually pay attention to scientific diet management, scientific work and rest, quit smoking and alcohol.