Hello.
I am trying to add new row in xml file but my code is not working can any guide me about my code?
my back end code is:
DataSet Xds = new DataSet();
Xds.ReadXml(Server.MapPath("~/Student_ExamPaper_xml/" + Student_Question_paper_xml + ".xml"));
DataRow Xrow = Xds.Tables[0].NewRow();
Xrow["Question_ID"] = "Question_" + question_id;
Xrow["Question_detail"] = Question_detail.Text;
Xrow["Option_1"] = Question_detail.Text;
Xrow["Option_2"] = Question_detail.Text;
Xrow["Option_3"] = Question_detail.Text;
Xrow["Option_4"] = Question_detail.Text;
Xrow["Radion_Button_index"] = Question_detail.Text;
Xds.Tables[0].Rows.Add(Xrow);
Xds.AcceptChanges();
Xds.WriteXml(Server.MapPath("~/Student_ExamPaper_xml/" + Student_Question_paper_xml + ".xml"));
and xml fomrat:
Please Guide me.... thanks in advance
Sakthi VelPosted May 8, 2017, 3:12 AM