  In order to constrain the density of intermediate-mass black holes (IMBHs) in
galaxies, we run smoothed particle hydrodynamics (SPH) simulations of a
gas-rich disc dwarf galaxy, where different halo and disc populations of IMBHs
are embedded. IMBHs, when passing through dense gas regions, can accrete gas
and switch on as X-ray sources. We derive the luminosity distribution of
simulated IMBHs, by assuming that they accrete at the Bondi-Hoyle rate. The
X-ray distribution of simulated IMBHs has been compared with that of observed
sources in the dwarf galaxy Holmberg II, chosen for its richness in gas, its
small mass (compared to spiral galaxies), and the accuracy of the available
X-ray measurements. Holmberg II also hosts one of the strongest IMBH
candidates. From this comparison, we find that the density parameter of disc
(halo) IMBHs must be <~ 10^-5 Omega_b (<~ 10^-2 Omega_b, where Omega_b is the
density parameter of baryons), for a radiative efficiency 10^-3 and an IMBH
mass of 10^4 solar masses. These constraints imply that a dwarf galaxy like
Holmberg II cannot host more than 1 (1000) disc (halo) 10^4 solar mass IMBHs.
