We present a Monte Carlo model of electron transport in mesoporous films of TiO2 particles in which electrons execute a random walk through a chain of spherical grains with traps at the surface of the grains. This has been used to simulate transient photocurrents in dye sensitized nanocrystalline solar cells. By comparing our results with a model based on solutions of the continuity equation for the free and trapped electron densities in which the film is treated as a homogeneous medium, we find that necks between grains have a noticeable effect on reducing the photocurrent. Values of an effective electron diffusion coefficient have been deduced by comparing an analytical solution to the continuity equation for the free electrons, in which the traps and back-reaction are ignored, with the numerical results from the Monte Carlo and continuum models. To the authors' knowledge, this is the first time that the influence of the grain connectivity on electron transport has been modeled.