Washing your hair more often does help to get rid of dandruff because when you wash your hair the dandruff is removed.
However you should use a medicated dandruff shampoo when washing your hair to rid it of dandruff and you must continue using medicated shampoo to wash your hair to rid your hair of dandruff.
Besides using the medicated dandruff shampoo you should also use a medicated dandruff hair conditioner after washing your hair.
I would recommend washing your hair daily with the dandruff shampoo until you get rid of most of the dandruff and then wash your hair again a 3 to 4 times per week.
That is unless you get more dandruff coming back and then you can switch back to washing your hair everyday.