We constrain cosmological models where the primordial perturbations have both an adiabatic and a (possibly correlated) cold dark matter (CDM) or baryon isocurvature component. We use both a phenomenological approach, where the primordial power spectra are parametrized with amplitudes and spectral indices, and a slow-roll two-field inflation approach where slow-roll parameters are used as primary parameters. In the phenomenological case, with CMB data, the upper limit to the CDM isocurvature fraction is alpha<6.4% at k=0.002Mpc^{-1} and 15.4% at k=0.01Mpc^{-1}. The median 95% range for the non-adiabatic contribution to the CMB temperature variance is -0.030<alpha_T<0.049. Including the supernova (or large-scale structure, LSS) data, these limits become: alpha<7.0%, 13.7%, and -0.048<alpha_T< 0.042 (or alpha<10.2%, 16.0%, and -0.071<alpha_T<0.024). The CMB constraint on the tensor-to-scalar ratio, r<0.26 at k=0.01Mpc^{-1}, is not affected by the nonadiabatic modes. In the slow-roll two-field inflation approach, the spectral indices are constrained close to 1. This leads to tighter limits on the isocurvature fraction, with the CMB data alpha<2.6% at k=0.01Mpc^{-1}, but the constraint on alpha_T is not much affected, -0.058<alpha_T<0.045. Including SN (or LSS) data, these limits become: alpha< 3.2% and -0.056<alpha_T<0.030 (or alpha<3.4% and -0.063<alpha_T<-0.008). When all spectral indices are close to each other the isocurvature fraction is somewhat degenerate with the tensor-to-scalar ratio. In addition to the generally correlated models, we study also special cases where the perturbation modes are uncorrelated or fully (anti)correlated. We calculate Bayesian evidences (model probabilities) in 21 different cases for our nonadiabatic models and for the corresponding adiabatic models, and find that in all cases the data support the pure adiabatic model.