Daniel 9:17 & 18a

"'Now, our God, hear the prayers and petitions of your servant. For your sake, O Lord, look with favor on your desolate sanctuary. Give ear, O God, and hear; open your eyes and see the desolation of the city that bears your Name.'" NIV translation

Daniel appeals to God based on the fact that it is God's city and temple that has been destroyed. His name is associated with them and so not honored while it is in this state.

Daniel 9:18b & 19

"'We do not make requests of you because we are righteous, but because of your great mercy. O Lord, listen! O Lord, forgive! O Lord, hear and act! For your sake, O my God, do not delay, because your city and your people bear your name.'" NIV translation

Daniel makes it very clear that the basis for his requests is the very nature of God and a desire to honor His name. We can learn a lot from this part of Daniel's prayer as he says that he does not appeal to God based on his righteousness. This speaks to the fact that we can all call upon the name of the Lord and be saved. If we were required to be righteous before we asked God for anything, it would be impossible to ask Him to save us from our sins.