We consider Sturm-Liouville problems on the finite interval. We show that spectral data for the case of Dirichlet boundary conditions are equivalent to spectral data for Neumann boundary conditions. In particular, the solution of the inverse problem for the first one is equivalent to the solution of the inverse problem for the second one. Moreover, we discuss similar results for other Sturm-Liouville problems, including a periodic case.