Luke 1:6

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

Acts 13:22

and, having removed him, He raised up for them David to be their king; to whom bearing testimony, He said, 'I found David the son of Jesse, a man after My heart, who will do all My will.'

Acts 13:36

For David, indeed, having served his own generation according to the will of God, fell asleep, and was added to 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

Luke 1:6
And they were both righteous before God, walking in all the commandments and ordinances of the law blameless.
Acts 13:22
and, having removed him, He raised up for them David to be their king; to whom bearing testimony, He said, 'I found David the son of Jesse, a man after My heart, who will do all My will.'