CREATE TABLE table_28934 ("District" TEXT, "Incumbent" TEXT, "Party" TEXT, "First elected" TEXT, "Result" TEXT, "Candidates" TEXT)

When was the incumbent first elected in the district where the result was a democratic-republican gain?
SELECT "First elected" FROM table_28934 WHERE "Result" = 'Democratic-Republican gain'
SELECT "First elected" FROM "table_28934" WHERE "Result" = 'Democratic-Republican gain'