Coherent and dissipative transport of a Bose-Einstein condensate inside an optical lattice