The board-to-board connector is for electrically connecting two mutually separated circuit boards, and includes a first connector that is connected to the circuit board and a switch connector for serially connecting the first connector, wherein the first connection The device is provided with a first terminal that is connected to the circuit board and a body that houses the first terminal. The adapter connector is provided with a second terminal and a body for accommodating the second terminal. The two extended ends of the second terminal can be respectively mated with the first terminal to achieve a first connection with the two circuit boards respectively. The electrical connection of the device, wherein the end of one of the first terminal and the second terminal has an elastic portion that is reversely bent, and the body and the second terminal can be selected according to the spacing requirement of the circuit board.