When approaching a question like this, it’s important to identify the two compounds that we are dealing with first. Sodium is an alkali metal, and therefore the metallic structure that it forms comes from metallic bonds. One of the properties of metals is that they can conduct electricity in solid and molten state. Sodium’s sea of delocalized electrons among the unipositive ions present in the structure is what gives it its conductivity. These delocalized electrons are present in both a solid and molten state, therefore sodium can conduct electricity in both states. Sodium iodide is heteroatomic, and the electronegativity difference between sodium and iodide makes their bond ionic. Ionic compounds form what is called a crystal lattice structure. An ionic crystal lattice can only conduct electricity in the molten state. This is because ionic bonds are rigid and do not allow for free flow of electrons. In a molten state the bonds become much weaker due to the increased kinetic energy of the atoms, the electrons can move more freely, and the compound can conduct electricity. Hence the sodium’s metallic structure allows for conductivity in both the solid and molten state, whereas sodium iodide’s crystal lattice structure only allows for conductivity in the molten state.