Perhaps God did answer your prayer, saying, “No”.  There seems to be the assumption that God always answers prayers by giving the person exactly what they asked for. God answers prayers in three ways, just as our human parents do: 1) Yes, you can have what you want and I will be glad to grant it or make it happen, 2) No, you cannot have what you want, and 3) Maybe later. If one always gets what they ask for they develop a sense of entitlement and expect to always get what they want. They may come to feel things will always go the way they wish. 

The object of prayer is to bring the heart and mind of the child of God into contact with the heart of God. Prayer helps the child to realize the fatherhood of God, his love, and his deep interest in every item of our welfare. Matthew 6 gives good suggestions about what our attitude should be and how to pray. We are to pray, as it tells us in v. 9-13, for Gods kingdom to come.

While there are many scriptures that tell us that if we ask God for something, he will give it to us (Matthew 21:22, Matthew 7:7, John 11:22, Zechariah 10:1), there is also the scripture in James 4:3 which says, You ask and do not receive, because you ask with wrong motives, so that you may spend it on your pleasures. (NASV). 

I John 5:14 tells us that “if we ask anything according to His will, He hears us.” So, one of the most important purposes of prayer is to demonstrate to God that we have learned his divine plan for mankind and are now praying for its accomplishment, i.e. praying in accordance with His will. The more our prayers ask for things to be done in keeping with God’s will, what God wants (rather than what we want), the more often we will find our prayers answered.  

On other matters, where the specific will of God cannot be known, His answers will continue to fall into the three categories– “yes, no, later (not at this time).”  All of our prayerful requests should be made with the understanding, Not my will, but Thine be done.