I do not prescribe that shampoo and i guess you should meet that dermatologist in person or if an online consultation exists. Severe dandruff could indicate dandruff itself which is significant or can indicate beginning of some other skin condition like Seborrheic dermatitis or Scalp psoriasis. Based on your description of pain on the scalp it looks like a superficial bacterial infection usually caused by staphylococcus aureus. Sometimes they co-exist with fungal folliculitis and can be determined with more precision during a consultation. Kindly consult a dermatologist for exact diagnosis and treatment plan. It is also important to prevent their relapse once you have got it cured. A decolonization regimen suggested by your doctor will help.
Next Steps
You can meet a Dermatologist for proper examination.
Health Tips
You can consult me online for personal recommendations.