Then he called for Solomon his son, and charged him to build a house for Yahweh, the God of Israel.
"Behold, a son shall be born unto thee"  (1 Chronicles 22:9).  The words used here show that David was referring to the words of God through Nathan  (2 Samuel 7:12-14).  Yes, God promised that son, all right, but David failed to understand what God said about WHEN that son would be born.  It would not happen during David's lifetime, but when thou shalt sleep with thy fathers  (2 Samuel 7:12).