Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi guys,

i want to know how can i store a specific node in dataset.

i have four nodes in xml file. i want a only one node is stored in dataset.
please help me in this.

thanks
Posted
Comments
Prerak Patel 12-Sep-11 5:31am    
Not clear.

1 solution

Try this

 XmlDocument doc = new XmlDocument();
doc.LoadXml(upXml);//upXML is a string variable containing XML
var fnode = doc.GetElementsByTagName("name")[0];//Getting specific node name(it is more than 1 so we are using 0th positioned node
var fval = fnode.Attributes["ab"].Value;//accessing node's attribute ab
 
Share this answer
 
Comments
Member 8214635 12-Sep-11 5:42am    
how can i store it in dataset?
Syed Salman Raza Zaidi 12-Sep-11 6:28am    
Check this
http://www.codeproject.com/KB/XML/Use_of_XML_File.aspx

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