Yengesen Pillay was in hospital under police guard, said prosecutor Yusuf Baba.
“Upon his discharge, he will be brought to court,” said Baba.
Pillay would face a schedule six murder charge when he appeared in court on August 28.
It was unclear when or how he had tried to commit suicide.
He was arrested in Pietermaritzburg on Tuesday after he went on the run following the stabbing at the weekend, said police.
Gauteng police spokesman Captain Tsekiso Mofokeng said the injured woman was found by a passer-by at around 5pm on Saturday.
On Sunday, ER24 spokesman Werner Vermaak said the woman, believed to be in her late 30s, had sustained around 50 stab wounds.
“It is understood that another woman and her child were driving along Peter Place when the child noticed [the woman] lying near a boom gate at an office park,” Vermaak said.
“Paramedics found the injured woman barely responsive and breathing. Paramedics indicated that she [the victim] lost a vast amount of blood and counted approximately 50 stab wounds on her body.”
Vermaak said the woman was rushed to hospital for further care, but she died.