This is because in the solid the ions of sodium and chlorine are strongly attracted to one another and are not able to move easily. In the melt or in solution the ions are able to move more freely and so can conduct electricity. Mains Electricity - don't mess with it. Do not try any experiments with mains electricity. Be afraid, be very afraid of it, I know I am.
Mains electricity differs in two main ways to the electricity produced by batteries.
First of all it is more powerful. Other countries have different rates - perhaps you could look this up. To understand how ac current works it might be useful to compare it to a grindstone, provided the grindstone is moving it doesn't matter which direction it is moving - it will still grind. Firstly the generation of ac is a lot simpler than dc and secondly only ac can work a transformer. If you consider your mains supply, the chances are that you live some distance away from the generator which supplies your electricity.