2 Samuel 7:4-5

4But that same night the word of the Lord came to Nathan, 5Go and tell my servant David, ‘Thus says the Lord: aWould you build me a house to dwell in?

1 Kings 8:19

19 bNevertheless, you shall not build the house, but your son who shall be born to you shall build the house for my name.’

1 Chronicles 22:7-8

7David said to Solomon, “My son, cI had it in my heart to build a house to the name of the Lord my God. 8But the word of the Lord came to me, saying, d‘You have shed much blood and have waged great wars. You shall not build a house to my name, because you have shed so much blood before me on the earth.

1 Chronicles 28:2-3

2Then King David rose to his feet and said: “Hear me, my brothers and my people. eI had it in my heart to build a house of rest for the ark of the covenant of the Lord and for the ffootstool of our God, and I made preparations for building. 3But God said to me, g‘You may not build a house for my name, for you are a man of war and have shed blood.’

2 Chronicles 6:8-9

8But the Lord said to David my father, ‘Whereas hit was in your heart to build a house for my name, you did well that it was in your heart. 9Nevertheless, it is not you who shall build the house, but your son who shall be born to you shall build the house for my name.’
Copyright information for ESV