The shear viscosity for a moderately dense granular binary mixture of smooth hard spheres undergoing uniform shear flow is determined. The basis for the analysis is the Enskog kinetic equation, solved first analytically by the Chapman-Enskog method up to first order in the shear rate for unforced systems as well as for systems driven by a Gaussian thermostat. As in the elastic case, practical evaluation requires a Sonine polynomial approximation. In the leading order, we determine the shear viscosity in terms of the control parameters of the problem: solid fraction, composition, mass ratio, size ratio and restitution coefficients. Both kinetic and collisional transfer contributions to the shear viscosity are considered. To probe the accuracy of the Chapman-Enskog results, the Enskog equation is then numerically solved for systems driven by a Gaussian thermostat by means of an extension to dense gases of the well-known Direct Simulation Monte Carlo (DSMC) method for dilute gases. The comparison between theory and simulation shows in general an excellent agreement over a wide region of the parameter space.