Having fillings and applying medicine to the teeth does not affect the fast
Question

I have braces on my teeth and every three weeks I have to go to the dentist and he adjusts the braces on my teeth, and he puts some things and materials in my mouth. Does this invalidate the fast?.
Praise be to Allah.That does not invalidate the fast so long as you do not deliberately swallow any of these materials. If it is possible to do that at night, that will be better and more on the safe side with regard to your fast. 
Shaykh Ibn Baz (may Allah have mercy on him) was asked (15/285): If a person has a toothache and he goes to the dentist, and he does some cleaning or a filling or pulls out one of his teeth, does that affect his fast, or if the dentist gives him an injection to numb his tooth, does that affect his fast? 
He replied: 
The things mentioned in the question do not affect the validity of the fast, rather that is excused. But he has to be careful to avoid swallowing any of the medicine or blood. Similarly, the injection mentioned does not invalidate the fast either, because it is not like food and drink, and the basic principle is that the fast remains valid. End quote.