Dandruff is frequently caused by scalp dryness rather than by bacterial action. The most effective way to solve dryness is to wash your hair every other day using water as hot as you can stand and to massage the scalp as firmly as you can while using a mild shampoo. I worked as a hairdresser for some years and this method worked in most cases.
If this hasn't solved the problem in a few weeks, use any of the various medicated shampoos designed to combat bacteria. Certain well-known anti-dandruff shampoos, which I'd better not name, are completely ineffective and while curing the problem temporarily will probably worsen the dandruff. Speak to a trained hairdresser or pharmacist for recommendations.
Don't confuse dandruff with dry skin. Dandruff must be treated with a medicated shampoo try one from your local salon it will cost more than the typical head and shoulders, but it's worth every penny. Joico and Matrix both have anti-dandruff shampoos that work great. DON'T scrub your head with hot water you will only irritate it.