Yeast Infection

Is it absolutely necessary to see the doctor for a yeast infection when you're pregnant? Or can I buy something over the counter and it be effective? Please let me know your experience with most effective treatments.