It wont work either. The spacing between the pins for the polarized header you referred is 0.1 inch, but the pins of the JST connector required for the sharp ir sensor are 2mm apart.If you don't want to buy a cable, just solder your cable on the PCB.