We calculate the next-to-leading order (NLO) quantum chromodynamics (QCD) corrections to inclusive processes $W^+to J/psi(eta_c)+c+bar{s}+X$ and $W^+to B_c(B_c^{*})+b+bar{s}+X$ in the framework of nonrelativistic QCD (NRQCD) factorization formalism. Result indicates that the NLO corrections are significant, and the uncertainties in theoretical predictions with NLO corrections are greatly reduced. The charmonium and $B_c$ meson yielding rates at the Large Hadron Collider (LHC) are given.