Try sucking on throat lozenges or hard candy. Often times, that will stifle the coughing reflex. However, a barky, consistent cough can be a bad sign, so if it continues longer than a few weeks, consult your doctor.
Dry cough that lasts more than four weeks may be tuberculosis.
If this is your case do not play with the health of others. The transmission is very easy and attack those on a low immune system.