The best way to deal with excessive sweating is to use a non-prescription anti-dandruff shampoo. Try Cetaphil, Dove, or any other good brand. These shampoos can help control the condition by killing off sweat causing bacteria and loosening dead skin cells so they can fall from your head when you shower. I have been using this method for many years and it works very well!
If you do not want to go with a non-prescription anti dandruff shampoo there are prescription products that will work as well but be sure that they contain antifungals or an antibiotic in them since these two ingredients will kill the fungus behind the problem of excessive sweating on your scalp/hairline area.