Hi,
I want to do following two steps. I am already done with first step. But I can't do the second step. Could anyone give me any idea how to do it?
Step 1: After serialization, I load XML file's data in a datagrid in tabular format.
Step2 : Now I want to add row in datagrid. And I want to save newly added data to same XML file.
Thanks
Neel
XML Serialization
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 21, 2010, 10:37 PM EST
See following code:
First create Dataset from XML file:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { // We are checking against the "ADD" if (e.CommandName == "ADD") { string name = ((TextBox)GridView1.FooterRow.FindControl("txtName")).Text; AddNewRecord(name); } } void AddNewRecord(string name) { DataSet dsPerson = new DataSet(); DataRow dr = dsPerson.Tables[0].NewRow(); dr["Name"] = 1; dsPerson.Tables[0].Rows.Add(dr); }Now you want to export the new updated Dataset to XML:
Please mark the answer if it helps.