An electrical connector includes an insulative housing having a central section defining a plurality of passageways therein for receiving contact elements and two end sections. Two latching members have a U-shaped structure fit over the end sections. Each latching member has a latching arm extending from a bottom wall of the U-shaped structure thereof for engaging with a mating connector. Each latching member has a board lock integrally formed therewith. The board lock includes two spaced resilient legs extending from a side wall of the U-shaped structure for engaging with a hole defined in a circuit board to mount the connector thereto.