News reached the Messenger of Allah ﷺ about something concerning his companions, so he stood to address them and said, "Paradise and the Fire have been shown to me, and I have never seen a day like this in good and in evil. If you knew what I know, you would laugh little and weep much."No day had ever been harder on the companions of the Messenger of Allah ﷺ than that one. They covered their heads, weeping with stifled sobs.Then Umar stood up and said, "We are pleased with Allah as our Lord, with Islam as our religion, and with Muhammad as our Prophet."Then that man stood up and asked, "Who is my father?"He replied, "Your father is so-and-so."Then was revealed, "O you who believe, do not ask about things which, if shown to you, would distress you" [Maidah 5:101].
بلغ رسول الله ﷺ عن أصحابه شيء، فخطب، فقال: عرضت على الجنة والنار، فلم أر كاليوم في الخير والشر، ولو تعلمون ما أعلم، لضحكتم قليلا ولبكيتم كثيرا. قال: فما أتى على أصحاب رسول الله ﷺ يوم أشد منه. قال: غطوا رؤوسهم ولهم خنين. قال: فقام عمر، فقال: رضينا بالله ربا وبالإسلام دينا وبمحمد نبيا. قال: فقام ذاك الرجل، فقال: من أبي؟ قال: أبوك فلان فنزلت {يايها الذين امنوا لا تسألوا عن اشيآء ان تبد لكم تسؤكم}.
Bukhari related it in tafsir (4621), and Muslim in virtues (23:2359), both through Shuba, from Musa bin Anas, from Anas, who said, then he mentioned it. The wording given is Muslim's, while Bukhari's wording is abridged.