In 1842, Ernest married Princess Alexandrine of Baden in what was to be a childless marriage. As reigning Duke, he supported the German Confederation in the Schleswig-Holstein Wars against Denmark, sending thousands of troops and becoming the commander of a German corps; he was instrumental in the 1849 victory at the battle of Eckernförde against Danish forces. After King Otto of Greece was deposed in 1862, the British government put Ernest's name forward as a possible successor. Negotiations concerning this failed for various reasons—not least of which was that he would not give up his beloved duchies in favor of the Greek throne.