Hi Saravanan,
Thanks for your response. But what I mean to say is lets consider I m getting DataTable1, DataTable2, DataTable3, ..... records.
Eg. In my code file, I have written below like code
string path = "~/App_Data/Customer.xml";
path = Server.MapPath(path);
WriteXMLFile(DataTable1, path);
WriteXMLFile(DataTable2, path);
WriteXMLFile(DataTable3, path);
for this I have declared one method,
private void WriteXMLFile(DataTable dTable, string path)
{
System.Text.StringBuilder strB = new System.Text.StringBuilder("<?xml version=\"1.0\" standalone=\"yes\"?>", 1000);
strB.Append("<Customer>");
foreach (DataRow row in dTable.Rows)
{
strB.Append("<Category AutoID=\"" + row["AutoID"] + "\" Name = \"" + row["Title"] + "\" />");
}
strB.Append("</Customer>");
System.IO.File.WriteAllText(path, strB.ToString());
}
Here I want to show all three datatable records into the customer.xml
If any idea then let me know...
Tripati_tutu, if this helps please login to Mark As Answer. | Alert Moderator