I agree with Eskielover to consult your doctor and focus on eating healthy (what you eat). I gained more weight than I should have with both of my pregnancies but it all came back off because I was able to breast feed. I hope you have the opportunity to do this.
It is natural to gain some weight when you are pregnant.
Try to go easy on yourself about this.