Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to read the data in xml file and store those values in hash table.
after loading the excel, to create hash table.
var data = doc.Element("testes").Elements("teste");


getting error for this line at element

Error 1 'System.Xml.XmlDocument' does not contain a definition for 'Element' and no extension method 'Element' accepting a first argument of type 'System.Xml.XmlDocument' could be found (are you missing a using directive or an assembly reference?)
Posted
Updated 6-Aug-13 18:48pm
v2

here is an example on how to export and import data from datatable to xml vice versa
dt is datatable

C#
dt.TableName = "MyTable";
dt.WriteXml("Path\FileName.xml", XmlWriteMode.WriteSchema);

/*Import xml to datatable */
dt.TableName = "MyTable";
dt.ReadXml("Path\FileName.xml");
 
Share this answer
 
v3
how-to-read-a-xml-file-and-return-a-hashtable[^]

Check the links.hope it will help
 
Share this answer
 
Comments
valluru's 7-Aug-13 2:45am    
thanks...
[no name] 7-Aug-13 2:48am    
u r welcome..please accept the solution if it helped...so that it will easy for future reference..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900