Hi,
By pain medicine I assume you mean local anesthetic,
delivered by injection? There are several possibilities
for feeling pain, such as you having a low threshold, or
maybe the dentist missed the nerve by too much. If
you were taking some drugs or had other medical
complications at the time it may also affect with the
spread of the anesthetic.
My feeling is that here in Canada, the dentist should
have a responsibility to make sure the patient is
comfortable, and if you made a gesture during the
procedure indicating excessive pain something should
have been done, like another injection. Sorry to hear
that your experience wasn't so good, but in fact many
European countries don't use local anesthetics at all
when filling cavities.
Hope that helps.