Click here to Skip to main content
15,909,039 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
how to read an xml tag in c# 2.0
Posted
Comments
Manfred Rudolf Bihy 12-Jan-12 9:45am    
It would certainly be awefully nice of you to deliver some supplemental information regarding your goals and what you've already tried.

Thanks for your cooperation!

I suggest you google something like "c# read XML", that will get you started.
I also suggest you read the site FAQs and the guidance about how to ask a question, you question doesn't state what you have tried (people will assume nothing and that you want code written for you) or what has gone wrong, also your question lacks detail about what you are trying to achieve.
 
Share this answer
 
v2
Comments
Manfred Rudolf Bihy 12-Jan-12 9:46am    
Agreed! 5+
One way to read and break down XML data is via XPath[^]s. Take a look at this tutorial[^]. It has a relatively simple syntax[^] and is quite easy to use.

Regards,

Manfred
 
Share this answer
 
You try for this it is working code by this you can read Xml tags:
C#
private void Button1_Click(object sender, EventArgs e)
    {
            
    XmlTextReader reader = new XmlTextReader("C:\\Users\\Dell\\Desktop\\New folder\\XMLFile1.xml");   //This is path n name of xml file

            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                   case XmlNodeType.Element: 
                         MessageBox.Show("<" + reader.Name);
                         break;
                 }
             }
    }

regarding any query about XML then always welcome...
 
Share this answer
 
v2

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