Except of course for James A. Garfield in 1880 who was a sitting member of the House of Representatives and a Senator-elect from the State of Ohio when elected President. He became President-elect and then President, and then dead soon thereafter.
Quite a guy...
dvwjr
He was also a general, so I don’t count him.