For store this in datatable i am using following strategies
//Code in sort form.....
xmldoc1.LoadXml(responseFromServer1); // I got the above XML here
XmlNodeList leg = xmldoc1.GetElementsByTagName("Leg");
for (int i = 0; i < leg.Count; i++)
{
for(...........
.................
dr1["From"] = leg[i].ChildNodes[0].InnerText.ToString(); // here i m storing the value of node in datatable
...............
...............
}
but I think it is not good code.
Can any one tell me the bast way to achieve my goal?

Amit ChoudharyPosted Feb 21, 2011, 7:07 AM
Reading the XML file with FileStream is the fastest way to read any XML file. Go through below article by Mahesh:
http://www.c-sharpcorner.com/uploadfile/mahesh/readwritexmltutmellli2111282005041517am/readwritexmltutmellli21.aspx
Simplest way, You can also use DatTable1.ReadXml() to load the xml file data in Datatable directly but i'm having doubt you may need to format your XML file little more. like adding the root element and an XML tag specifying the version and all information to the XML file.
If you need to manipulate your XML then use XPath query by loading XMLDoc object which you have used.
Well go for the approach which best suited you.
Thanks.
div vPosted Feb 21, 2011, 1:23 AM
ref this link it helps you....
http://www.codeproject.com/KB/database/DataTableAsXMLToDataBase.aspx