Question: For what purpose did David order Uriah to move to the most dangerous part of the battlefield?
About the article "Bathsheba", section "Biblical narrative".

Candidate passages:
The meaning of the Hebrew form of the name "Bathsheba" is "daughter of the oath", "bat" meaning daughter.
The second part of the name appears in as "shua" (signifying "wealth") (compare ).
Bathsheba was the daughter of Eliam (, who is called Ammiel in ).
Her father is identified by some scholars with Eliam mentioned in as the son of Ahithophel, who is described as the Gilonite.
(See King David's Warriors.
)Bathsheba was the wife of Uriah the Hittite, and afterward of David, by whom she gave birth to Solomon, who succeeded David as king.
(United Kingdom of Israel and Judah).
The story of David's seduction of Bathsheba, told in , is omitted in Chronicles.
The story is told that David, while walking on the roof of his palace, saw Bathsheba, who was then the wife of Uriah, having a bath.
He immediately desired her and later made her pregnant.
In an effort to conceal his sin, David summoned Uriah from the army (with whom he was on campaign) in the hope that Uriah would re-consummate his marriage and think that the child was his.
Uriah was unwilling to violate the ancient kingdom rule applying to warriors in active service.
Rather than go home to his own bed, he preferred to remain with the palace troops.
After repeated efforts to convince Uriah to have sex with Bathsheba, the king gave the order to his general, Joab, that Uriah should be placed in the front lines of the battle, where it was the most dangerous, and left to the hands of the enemy (where he was more likely to die).
David had Uriah himself carry the message that ordered his death.
After Uriah was dead, David made the now widowed Bathsheba his wife.
David's action was displeasing to the Lord, who accordingly sent Nathan the prophet to reprove the king.
After relating the parable of the rich man who took away the one little ewe lamb of his poor neighbor (II Samuel 12:1-6), and exciting the king's anger against the unrighteous act, the prophet applied the case directly to David's action with regard to Bathsheba.
The king at once confessed his sin and expressed sincere repentance.
Bathsheba's child by David was struck with a severe illness and died a few days after birth, which the king accepted as his punishment.
Nathan also noted that David's house would be cursed with turmoil because of this murder.
This came to pass years later when one of David's much-loved sons, Absalom, led an insurrection that plunged the kingdom into civil war.
Moreover, to manifest his claim to be the new king, Absalom had sexual intercourse in public with ten of his father's concubines, which could be considered a direct, tenfold divine retribution for David's taking the woman of another man.
(II Samuel 16:20–23) In David's old age, Bathsheba secured the succession to the throne of her son Solomon, instead of David's eldest surviving son Adonijah.
Some commentators have written that Bathsheba may have written at least part of Proverbs 31 as suggested by the postulated connections between King Lemuel aka King Solomon.
The story of David's adultery sets up the context for the penitential Psalm 51 (50), also known as "Miserere" ("Have mercy on me, O God").
"All references from the JPS translation (1917) unless otherwise stated."
: These be the names of the mighty men whom David had: [...] "39": Uriah the Hittite: thirty and seven in all.
: These also are the chief of the mighty men whom David had, who strengthened themselves with him in his kingdom, and with all Israel, to make him king, according to the word of the LORD concerning Israel.
[...] "41": Uriah the Hittite, Zabad the son of Ahlai, : 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?
"4": And David sent messengers, and took her; and she came in unto him, and he lay with her; for she was purified from her uncleanness: and she returned unto her house.
["Uriah the Hittite" named 4 more times in this chapter.]
: [Nathan:] Wherefore hast thou despised the commandment of the LORD, to do evil in his sight?
thou hast killed Uriah the Hittite with the sword, and hast taken his wife to be thy wife, and hast slain him with the sword of the children of Ammon.
"10": Now therefore the sword shall never depart from thine house; because thou hast despised me, and hast taken the wife of Uriah the Hittite to be thy wife.
: 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.
"(NAB)": As the first husband of the mother of Solomon (i.e.
Bathsheba) in the genealogy of Jesus.  
  These be the names of the mighty men whom David had: [...] 39 Uriah the Hittite: thirty and seven in all.
These also are the chief of the mighty men whom David had, who strengthened themselves with him in his kingdom, and with all Israel, to make him king, according to the word of the concerning Israel.
[...] 41 Uriah the Hittite, Zabad the son of Ahlai,  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?
4 And David sent messengers, and took her; and she came in unto him, and he lay with her; for she was purified from her uncleanness: and she returned unto her house.
["Uriah the Hittite" named 4 more times in this chapter.]
[Nathan:] Wherefore hast thou despised the commandment of the , to do evil in his sight?
thou hast killed Uriah the Hittite with the sword, and hast taken his wife to be thy wife, and hast slain him with the sword of the children of Ammon.
10 Now therefore the sword shall never depart from thine house; because thou hast despised me, and hast taken the wife of Uriah the Hittite to be thy wife.
Because David did that which was right in the eyes of the , 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.  
According to Second Samuel, King David was tempted upon seeing Bathsheba bathe in her courtyard from the roof of his palace.
He had her brought to his chambers and had sex with her, resulting in a pregnancy.
Informed that her husband was Uriah, David summoned Uriah from battle to meet him, suggesting that he go home and "wash his feet," meaning to spend time at home and attend to his wife.
Uriah refused, claiming a code of honor with his fellow warriors while they were in battle.
It was common for warriors in preparation for battle to abstain from sex, as a practice of discipline.
After repeatedly refusing to see his wife Bathsheba, David sent Uriah to his commanding officer Joab with a letter that ordered to put Uriah in the front of the battle and have the soldiers move away from him so that he would be killed.
Despite Uriah's status as one of David's mighty men, British rabbi Jonathan Magonet observes that Uriah refers to Joab, not David, as 'my lord (or commander)' (2 Samuel 11:11).
Joab is, Magonet notes, a kingmaker who despatches ruthlessly his own military rivals, Abner and Amasa.
He is sufficiently powerful that David, on his deathbed, advises Solomon to arrange his death (1 Kings 2:5 - 6).
This prompts Magonet to speculate that David saw some deeper political threat from Joab through his entanglement with Uriah's wife. 
David committed adultery with Bathsheba, the wife of Uriah the Hittite.
Bathsheba became pregnant.
David sent for Uriah, who was with the Israelite army at the siege of Rabbah, so that he could sleep with his wife and conceal the identity of the child's father.
Uriah refused to do so while his companions are in the field of battle and David sent him back to Joab, the commander, with a message instructing him to ensure that Uriah died in battle.
David married Bathsheba and she bore his child, "but the thing that David had done displeased the Lord."
The prophet Nathan confronted David, saying: "Why have you despised the word of God, to do what is evil in his sight?
You have smitten Uriah the Hittite with the sword, and have taken his wife to be your wife."
Nathan presented three punishments from God.
First, that the "sword shall never depart from your house" (2 Samuel 12:10); second, that "Before your very eyes I will take your wives and give them to one who is close to you, and he will sleep with your wives in broad daylight", and finally, that "the son born to you will die" ().
David repented, yet David's child died.
David left his lamentations, dressed himself, went to the House of the Lord and worshiped, and then returned home to eat.
His servants asked why he wept when the baby was alive, but ended his mourning when the child dies.
David replied: "While the child was still alive, I fasted and wept.
I thought, 'Who knows?
The may be gracious to me and let the child live.'
But now that he is dead, why should I fast?
Can I bring him back again?
I will go to him, but he will not return to me."