Allah, the Mighty and Majestic, says: "And they followed what the devils recited during the reign of Sulayman (peace be upon him). It was not Sulayman (peace be upon him) who disbelieved, but the devils disbelieved, teaching people sorcery." [Surah al-Baqarah: 102]
Up to His saying: "But they could not harm anyone through it except by the permission of Allah, and they learned what harmed them and did not benefit them." (to the end of the verse) [Surah al-Baqarah: 102]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب القسامة / Q16494
Sayyidah Aishah (may Allah be pleased with her) said: Sorcery was worked upon the Prophet (peace and blessings be upon him), and its effect was that he would imagine he had done something when he had not done it. He supplicated to his Lord, then said: "Do you know that Allah has told me what I asked Him about?" Sayyidah Aishah (may Allah be pleased with her) said: "What is that, O Messenger of Allah?" He said: "Two men came to me; one sat by my head and the other by my feet. One of them said: 'What is wrong with this man?' The other said: 'He is bewitched.' He asked: 'Who bewitched him?' He said: 'Labid bin al-A'sam.' He asked: 'In what?' He said: 'In a comb, the hair that came off it, and the dried spathe of a male date palm.' He asked: 'Where is it?' He said: 'In a well called Dharwan, belonging to Banu Zurayq.'" Sayyidah Aishah (may Allah be pleased with her) said: The Messenger of Allah (peace and blessings be upon him) went to it, then came back to Sayyidah Aishah (may Allah be pleased with her) and said: "By Allah, its water was like the infusion of henna, and its palm trees were like the heads of devils." I said: "Why did you not take it out?" He replied: "Allah has cured me of it, and I disliked that any evil should spread among people from it."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب القسامة / 16494
It is narrated from Sayyiduna Sa'd (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "Whoever eats Ajwah dates every morning, neither poison nor sorcery will harm him that day."
And the wording of the other narration is: "seven Ajwah dates of Madinah".
Hadith Referenceالسنن الكبرى للبيهقي / كتاب القسامة / 16495