One way to ensure that you are getting high quality vitamins is to look the NSF logo on the bottle. NSF International is an independent, not-for-profit organization that helps protect consumers by certifying products and writing standards for food, water, air and consumer goods.
On top of this, look for manufacturers that offer a guaranty of potency. If the manufacturer does not stand behind their products, why should you trust them to by from them?
Yep, that holds true with vitamins too. Like Ourdia said, look for the NSF logo. That'll help. Also, if the vitamin is pharmaceutical grade, it goes through a much more rigorous testing process. Something "off the shelf" isn't guaranteed to disolve nor is it guaranteed to actually contain what's listed on the bottle. Pharmaceutical grade vitamins ARE required.