Is it true that eating too much sugar say for example doughnuts can give you headaches?
Our body needs sugar (carbohydrates) where most of our energy comes from. When you eat sugar, it's converted into glucose and carried in the blood to different parts including brain.
If you eat too much sugar, it can cause ‘reactive hypoglycaemia’ when your sudden rise of blood-glucose can trigger an over-production of insulin which in turn makes the blood-glucose levels fall too low. As result of excessive insulin release your brain is not receiving enough glucose and the symptoms could include headache and migraine.
Source: Migraine Fact Sheets at Migraine Trust
To prevent sugar/glucose crash from happening, you should limit your sugar intake (e.g. by eating smaller portions). Also exercising regularly increases sugar uptake which decrease excessive insulin release.