The D.C. Court of Appeals has upheld the criminal contempt conviction of a North Carolina man who was sentenced to 90 days in jail and fined $300 for ignoring court orders to provide adequate heat and hot water to tenants in three Euclid Street apartment buildings he owned.

Robert S. Farmer of Greensboro, N.C., was convicted in February 1982 and has been free on bond pending appeal. Farmer is one of the few city landlords ever to have received a jail sentence for housing code violations.

Neither Farmer nor his attorney could be reached yesterday.

In his appeal, Farmer had contended that he was not properly notified of the unusual court action brought against him by the tenants of buildings at 1014, 1030 and 1034 Euclid St. NW.

"Appellant's Farmer contention that he was denied the notice required by a Superior Court rule cannot be sustained," the court ruled.

Farmer has said that he has sold the Euclid Street buildings.

A spokesman for the Southern Columbia Heights Tenants Association, which helped the Euclid Street tenants in their suit, said all three buildings now have hot water, but they had intermittent heating problems last spring.

After no heat or hot water in the three buildings' 52 apartments for several weeks, the tenants took Farmer to court in the fall of 1981. In two separate rulings in November and December 1981, D.C. Superior Court Judge William S. Thompson ordered Farmer to correct the conditions in the apartments. Farmer also failed to show up for hearings in the court case.

On Jan. 19, l982, Thompson ordered Farmer to explain why he should not be held in criminal contempt for his continued failure to make repairs in the buildings.

"On Feb. 9, Farmer , for the first time in these proceedings, appeared in court with counsel," the three-judge panel said in its opinion. "At that time, Farmer neither claimed that he had not received notice of the court's earlier orders against him nor that he was unaware of the facts constituting the contempt charge or was unable to prepare a defense," the opinion stated.

Late last year Farmer pleaded no contest to six housing code violations in the same buildings in a case brought against him by the city government. In that case, D.C. Superior Court Judge Byron W. Sorrell gave Farmer a suspended 60-day sentence, fined him $600, and prohibited him from owning property in Washington for the next five years.

Hearings on a civil contempt citation in connection with the tenants' suit, which included charges of $5,000 a day until the major housing violations were corrected, have been continued several times.