The LORD has chosen Zion, He has desired it for His dwelling. Psalm 132:13

Is the Lord with you?

For the LORD is with thee. 2 Samuel 7:3
When David expressed his desire to Nathan the Prophet to build a house for the ark of God, Nathan hastily approved and encouraged him saying Go, do all that is in your heart, for the LORD is with you. 2 Samuel 7:3
Moreover as David has been prospering in all that he did and God has given him rest from all his enemies, Nathan thought that the desire is from the LORD. But it was not the intention of God for David to build the house, rather his son Solomon. 
God answers every prayer but sometimes the answer can be "No" to even a good work. And that "No" can turn out to be a blessing at the end. And we'll understand the reason for the denial in the future.
It is utmost important to : Commit your way to the Lord; trust in him, and he will act. Psalm 37:5
Have a Blessed Day!