Optical switches with wavelength selectivity are important and useful in dense wavelength division multiplexing (DWDM) systems, especially in network reconfiguration. One example of such devices is a switchable add/drop filter which is capable of switching between all-through state and wavelength adding (or dropping) state. The building block of such switches is a 2x2 wavelength switch. Most of the existing 2x2 switches, such as those involving two prisms operating in total internal reflection mode or total transmission mode, require light being coupled in and out of the fiber resulting in large device size and high insertion loss. In this paper, we design, analyze, and demonstrate a novel wavelength-selective 2x2 switch by recording electrically switchable holographic gratings in a layer of holographic polymer dispersed liquid crystal (H-PDLC) sandwiched between two side-polished fibers. We first demonstrate our novel idea experimentally, then analyze our result theoretically, and finally design optimized switches for both 100GHz and 50GHz DWDM systems. This device provides in-line operation capability and is particularly suitable for DWDM network reconfiguration.