However, Your Qid is holding only one data at a time. In this case, possibly the last "id" in dt2.
Two Solutions
1. Use an Array of Qid and while passing Qid as parameter in submitanswer(), use foreach for inserting
like
foreach id in Qid[]
en.submitanswer(id, id1, s, Qid[id])
2. Move
en.submitanswer(id, id1, s, Qid);
to the foreach loop above
like
foreach (DataRow dr in dt2.Rows)
{
Qid = Convert.ToInt32(dr["id"].ToString());
en.submitanswer(id, id1, s, Qid);
}