C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how do u Access element in XML document


Posted Date: 26 Jul 2008      Total Responses: 2

Posted By: syam kumar       Member Level: Silver     Points: 1


how do u Access element in XML document



Responses

Author: Sabu C Alex    28 Jul 2008Member Level: GoldRating:     Points: 5
hi syam

see this code

XmlDocument xDoc = new XmlDocument();
xDoc.GetElementById("elementname");

here you have to specify the element name. that will return that element

another one is

xDoc.GetElementsByTagName("")
here you can give the element name. that function will return a list of xml nodes means XmlNodeList. that is the collection XmlNodes

hope this will help you




Author: Ratheesh    29 Jul 2008Member Level: GoldRating:     Points: 1
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Server.MapPath("Employee.xml"));
XmlNodeList xmlnodes = xmldoc.SelectNodes
("Employee/EmpName");
DataGrid1.DataSource = xmlnodes;
DataGrid1.DataBind ();


Post Reply
You must Sign In to post a response.
Next : XML Translator.
Previous : XML serialization
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

SPOC

Contact Us    Privacy Policy    Terms Of Use