2 week old seen his doc & got stool softners. Doc think it may be dairy in my diet so im tryingformula. Is it ok to still nurse couple times a day to?

If the doctor.... ..Thinks it may be dairy in your diet, than the solution is not to try formula, it's to remove dairy from your diet. Keep nursing, lose the formula, and if it comes out of the bottom end of a cow, avoid eating it ....That mean no milk, cream, butter, yogurt, or anything else that falls into the "dairy" category.
Keep on nursing. It is very unusual for a baby to get constipated just because mom is taking dairy products. I wouod recommend that you continue breast feeding. Could it be that the amount of breast milk is not enough? Or are you takin some medicine that may cause constipation in the baby? Is your baby gaining weight? He should be starting to gain weight after the 1st week.