A nondissipative current carried in a type-II superconductor in the longitudinal magnetic field is known to be caused by the flux-pinning interaction, as is the current in the transverse magnetic field. However, only a few systematic experiments on the critical current density under the longitudinal magnetic field have been investigated from the viewpoint of flux-pinning. This paper reports the critical current density of Nb-Ta specimens measured as a function of the pinning strength in the longitudinal or transverse field. The longitudinal critical current density was found to depend strongly on the pinning strength. The result is compared qualitatively with the transverse critical current density from the viewpoint of the summation of the flux-pinning interactions.