1 Kings 15:5

Because David did that which was right in the eyes of the LORD, and turned not aside from anything that he commanded him all the days of his life, except only in the matter of Uriah the Hittite.

1 Kings 14:8

And tore the kingdom away from the house of David, and gave it you: and yet you have not been as my servant David, who kept my commandments, and who followed me with all his heart, to do that only which was right in my eyes;

2 Samuel 11:15-17

And he wrote in the letter, saying, Set Uriah in the forefront of the hottest battle, and retire from him, that he may be struck down, and die.

2 Samuel 12:9-10

Why have you despised the commandment of the LORD, to do evil in his sight? you have killed Uriah the Hittite with the sword, and have taken his wife to be your wife, and have slain him with the sword of the children of Ammon.

1 Kings 9:4

And if you will walk before me, as David your father walked, in integrity of heart, and in uprightness, to do according to all that I have commanded you, and will keep my statutes and my judgments:

Luke 1:6

And they were both righteous before God, walking in all the commandments and ordinances of the Lord blameless.

2 Samuel 11:3-4

And David sent and inquired after the woman. And one said, Is not this Bath-sheba, the daughter of Eliam, the wife of Uriah the Hittite?

1 Kings 15:3

And he walked in all the sins of his father, which he had done before him: and his heart was not perfect with the LORD his God, as the heart of David his father.

2 Kings 22:2

And he did that which was right in the sight of the LORD, and walked in all the way of David his father, and turned not aside to the right hand or to the left.

2 Chronicles 34:2

And he did that which was right in the sight of the LORD, and walked in the ways of David his father, and turned aside neither to the right hand, nor to the left.

Psalm 51:1

[To the Chief Musician. A Psalm of David when Nathan the prophet came unto him, after he had gone in to Bathsheba.] Have mercy upon me, O God, according to your lovingkindness: according unto the multitude of your tender mercies blot out my transgressions.

Psalm 119:6

Then shall I not be ashamed, when I have respect unto all your commandments.

Acts 13:22

And when he had removed him, he raised up unto them David to be their king; to whom also he gave testimony, and said, I have found David the son of Jesse, a man after my own heart, who shall fulfill all my will.

Acts 13:36

For David, after he had served his own generation by the will of God, fell asleep, and was laid with his fathers, and saw corruption:

Treasury of Scripture Knowledge

Summary

Because David did that which was right in the eyes of the LORD, and turned not aside from any thing that he commanded him all the days of his life, save only in the matter of Uriah the Hittite.

Bible References

David

1 Kings 15:3
And he walked in all the sins of his father, which he had done before him: and his heart was not perfect with the LORD his God, as the heart of David his father.
1 Kings 14:8
And tore the kingdom away from the house of David, and gave it you: and yet you have not been as my servant David, who kept my commandments, and who followed me with all his heart, to do that only which was right in my eyes;
2 Kings 22:2
And he did that which was right in the sight of the LORD, and walked in all the way of David his father, and turned not aside to the right hand or to the left.
2 Chronicles 34:2
And he did that which was right in the sight of the LORD, and walked in the ways of David his father, and turned aside neither to the right hand, nor to the left.
Psalm 119:6
Then shall I not be ashamed, when I have respect unto all your commandments.
Luke 1:6
And they were both righteous before God, walking in all the commandments and ordinances of the Lord blameless.
Acts 13:22
And when he had removed him, he raised up unto them David to be their king; to whom also he gave testimony, and said, I have found David the son of Jesse, a man after my own heart, who shall fulfill all my will.