An electric current is moving electric charges. In a metal, the electrons are moving while in a solution, only the dissolved ions are likely to be able to move.
Sodium chloride is the chemical name for salt. It is an ionic solid made up of sodium (Na+) and chloride (Cl-) ions. These charged ions are liberated in solution and can move if a voltage is applied across two electrodes. The circulating current can light a lamp.
Sugar, also called sucrose, is a molecular solid. In solution, the molecules are dispersed in the water but they are not attracted to the electrodes because they are electically neutral. The current does not circulate and the lamp is not lighted.