Yahweh uses a question to emphasize that David is not the one to build a house for Yahweh. This question can be translated as a statement. Alternate translation: "You will not build a house for me" (See: [[rc://en/ta/man/jit/figs-rquestion]])
Here "house" means a temple. In 7:11 Yahweh will say that he will build a house for David. There "house" means a family. If your language has a word that can express both ideas, use it here and in 7:11.