A tooth will normally have three layers
Enamel is the top layer and a very hard surface
Dentin is the second layer it is soft and the sensitive .
Pulp is the innermost core of the tooth and contains nerve tissue and blood vessels.
When there is a cavity extending only in enamel it will be painless .
when the cavity extends into dentin it will be sensitive to sweet,cold stuff .
when the cavity further progressess into pulp it will cause continuos pain.
You are having tooth pain only while eating sweet,sugar crystals,drinking cold water and rest of the time there is absolutely no pain clearly indicates that one or few of your teeth may be decayed till the dentin (second layer of tooth)
It can be treated by doing a filling(restoration)
If this condition is left untreated it can result in continuous pain where you may have to get root canal treatment for that tooth. Please dont neglect this stage try to visit dentist as soon as possible to avoid further damage.