Allah the Exalted revealed: And We caused a fount of (molten) brass to flow for him, and there were jinns that worked in front of him by the Leave of his Lord, and whosoever of them turned aside from Our Command, We shall cause him to taste of the torment of the blazing Fire. They worked for him what he desired, (making) high rooms, images, basins as large as reservoirs, and (making) cauldrons fixed (in their places). 'Work you, 0 family of David, with thanks!" But few of My slaves are grateful.
Then when we decreed death for him (Solomon), nothing informed them (jinns) of his death except a little worm of the earth, which kept (slowly) gnawing a way at his stick, so when he fell down, the jinns saw clearly that if they had known the unseen, they would not have stayed in the humiliating torment. Surah 34: 12-14
Related Quran Ayaaths of this Hadith.
Surah 6 : Ayah 84 Surah 4 : Ayah 163 Surah 27 : Ayah 15 Surah 27 : Ayah 16 Surah 27 : Ayah 17 Surah 27 : Ayah 18 Surah 27 : Ayah 19"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari