sentences:  He was elected as a Jacksonian to the 24th United States Congress, serving from March 4, 1835, to March 3, 1837, but was defeated for re-election.He was elected as a Democrat to the 27th United States Congress, serving from March 4, 1841, to March 3, 1843, but was again defeated for re-election.In February 1846, he was appointed New York County District Attorney and, when the office became elective under the State Constitution of 1846, was elected in May 1847 to succeed himself.