Only the female can sting. Simply killing the male will not solve your problem. To treat the carpenter bee holes use Drione Dust and a Crusader Duster. As the female enters the hole she will drag the dust into the nest and kill all the larvae, or there will be dust still there and active to kill any emerging juvenile carpenter even months later. After 2 or 3 days plug the holes.
Natural cork does a good job as a hole plugger.
This makes it easy to see new activity and keeps the dust inside to kill the larvae. If you must kill the harmless male carpenter bee then use a Wasp and Hornet Aerosol. Cypermethrin insecticide is excellent in controlling a variety of pests including spiders, ants and big roaches. For use in treatment and eradication of carpenter bee nests in walls or buildings. Includes Drione Dust, which is the product we recommend for carpenter bees and carpenter ants.