Montgomery County State's Attorney Andrew L. Sonner, speaking at a candidates' forum, rattled off a list of what he said were the "outstanding achievements" of his office during the 12 years that he has been the county's chief prosecutor.

Then Sonner, his face flushed, abruptly turned and pointed his finger toward Daniel J. Cassidy, his opponent in Tuesday's Democratic primary.

"This man took some of my sample ballots in the last campaign and illegally converted them to his own use," he charged.

"This is not the kind of man who should be the county prosecutor," shouted Sonner, who is being opposed for a second time by the 34-year-old Cassidy.

The outburst typifies a feud that began during the 1978 election, when Sonner clobbered Cassidy at the polls by a 2-to-1 margin. Sonner claimed then that Cassidy and his campaign workers stole 4,800 of Sonner's sample ballots and reprinted them for Cassidy.

Cassidy has denied Sonner's allegations.

A year after Sonner won that election, he filed a grievance unrelated to the campaign with the State's Attorney Grievance Committee against Cassidy and one of Cassidy's political advisers.

Sonner, 48, who has been accused by Cassidy of being vindictive, would not comment on the complaint, which was dismissed by the committee after a brief hearing. But according to the records of the grievance commission, Sonner had charged the two lawyers with unethically representing clients who had competing interests.

Cassidy said the grievance was a "typical example" of how Sonner, who is seeking an unprecedented fourth term, uses the power of his office to lash out at critics.

In many ways, their 1982 rematch closely resembles the political battle fought between Cassidy and Sonner four years ago.

But this time, Cassidy, who said he has raised $25,000, is outspending the incumbent 5-to-1 in a high-powered campaign that includes radio and television spots, T-shirts, posters, bumper stickers and a mailing to 70,000 voters.

CasSidy has been endorsed by the Fraternal Order of Police, the Coalition of Black Policy Officers of Montgomery County and several major labor unions.

Sonner said he has spent $5,000, mainly for campaign literature.

One item that was clearly a replay of the 1978 campaign was a recent charge by Cassidy that Sonner has traveled widely at government expense.

Sonner said that all of the trips cited by Cassidy either were taken in connection with his duties or were paid for with his own personal funds. Sonner said it is critical for a Prosecutor to be active in professional organizations such as the National District Attorneys' Association, of whichhe is vice president, and the Maryland State's Attorneys' Association, where he was president for two terms.

Sonner contends that Cassidy does not have enough legal experience to be an effective state's attorney, saying, "It's been six years since he's tried a case as a prosecutor."

Cassidy retorts: "I worked in the Prince George's County State's Attorney's office for four years, almost all of which was in the felony division. I tried more than 100 jury trials dealing with rapes, murders and other serious offenses."

"The people of Montgomery County want a prosecutor who is going to try some of the major cases, work with the police and develop a stronger victims' rights program," added Cassidy, who is in private practice in Rockville.

"In 12 years in office, Andrew Sonner has not done any of these very well. Sonner has said repeatedly that he doesn't think I have enough courtroom experience to do the job. But I already have five times as much trial experience as he had when he became state's attorney."

Sonner, who said he does not think the elected state's attorney should personally prosecute cases, dismissed Cassidy's claims by saying: "About the most significant thing Dan Cassidy has done during his legal career is run against me.