Repeating yeast infections!

Ok i keep getting yeast infections and I go to the doctor and they just give me a pill to help which does work till I get my period then I have a yeast infection all over again! I've increased eating yogurt and I take probiotics cut back on sugar all sorts of things but still I keep getting them! It's just so frustrating, especially since it's so painful to have sex with the husband. Does anyone have any advice on how to treat this or why I keep getting them????? Could it be my b.c.???