1 Chronicles 17:23

Therefore now, LORD, let the thing that thou hast spoken concerning thy servant and concerning his house be established for ever, and do as thou hast said.

The prayer belongs to the time when David first conceived the design of building a house worthy of the divine majesty and opened his mind about it to the prophet Nathan. Although God accepted David's good intentions, He refused him the honor of building the temple. The laying of its foundation, the completing of it, and the dedicating of it passed to Solomon his son.