Police arrested a part-time cook at The Dancing Crab, an upper Wisconsin Avenue restaurant, and another man early yesterday after they allegedly tried to rob the restaurant, held workers at gunpoint, exchanged gunfire with police and finally were flushed out with tear gas.

David Carmichael, 22, of 502 Fifth St. NW, and Robert Rowe, 30, of 1311 Third St. NE, were held in lieu of $1,000 bond after being arraigned on charges of assault with intent to rob while armed.

Workers at the popular seafood restaurant at 41st Street and Wisconsin Avenue NW spent yesterday cleaning up broken glass and debris left by more than a dozen tear-gas canisters that were shot into the eatery. Owner Fred Morris was in a gas mask trying to air out the two-story building.

The four-hour incident began just after midnight yesterday morning, as The Dancing Crab's night crew was preparing to close the restaurant. Four employes, but no customers, were in the restaurant when two men walked in. One of the men wore a ski mask and carried a pistol, and the other carried a shotgun, police said.

Bartender Glenn Leizeac was talking on the phone with his girlfriend when he saw the men and yelled, "No, no, no," before dropping the receiver. Alarmed, the woman called police.

Two waitresses ran toward the back of the restaurant, and the gunmen ordered Leizeac and another man to open a safe in a locked back room, police said. They said one of the gunmen had a key to the back room, but Leizeac and the other worker told the men they didn't know the safe's combination.

"I thought they were going to blow my head off when I said I didn't know the combination," Leizeac said. At the same time three police officers arrived at the scene, the gunmen ordered the two men to return to the front of the restaurant, according to police spokesman Lt. Hiram K. Brewton.

The gunmen slipped into a walk-in refrigerator, and Officers Charles Reed and Thomas Haworth exchanged gunfire with them, Brewton said. During the shooting, Leizeac ran out the front door and the other employe jumped through a plate glass window. Leizeac, who was slightly injured by flying glass, was treated at Sibley Hospital and released early yesterday, police said. The employe who leaped through the window was not hurt.

The officers left the restaurant, Brewton said, and a few minutes later one waitress was able to escape through the front door. The only employe who remained in the restaurant was waitress Theresa Tolino.

Within minutes, police cordoned off the area and set up lights as a helicopter hovered overhead.

Shortly after 2 a.m., after police fired tear gas canisters into the building, Tolino ran out the front door, shouting, "Don't shoot, don't shoot, it's me."

Police continued at intervals during the next hour to shoot tear gas into the building. One of the men surrendered at 2:50 a.m. The second man, who had hidden in a false ceiling, was dragged out by officers at 3:50 a.m.

Restaurant workers said they had no idea that Carmichael was one of those arrested until he was booked at the police station.