The gunman who killed 10 people and wounded several others in Sweden was connected with the adult education centre where he opened fire, police have said.