1 Chronicles 17:8
And I have been with thee whithersoever thou hast walked, and have cut off all thine enemies from before thee, and have made thee a name like the name of the great men that are in the earth. And I have been with thee whithersoever thou hast walked, and have cut off all thine enemies from before thee, and have made thee a name like the name of the great men that are in the earth.
The promise belongs to the account of David's desire to build a temple for God. It arose when David felt remorse that he himself dwelt in a palace of cedar while the ark still rested in the tabernacle. When he shared his plan, Nathan at first encouraged him to carry it out. God, however, had a different work appointed for David than the building of the temple. The building itself God entrusted to Solomon.