You can use wires like these
the ends slide into these housings
and connect pins of one board to pins of the other.