ovulation pain

Okay can anyone tell me if you can have ovulation pain for weeks because I have random cramps sometimes two weeks before my next period and they will last until it starts . Also with that can you get ovulation pain on the pill