Skip to content
Loading
  • Laxmidhar Sahoo
    0
    Hi try the bowllow code 
     
    1. private void button9_Click(object sender, EventArgs e)  
    2.         {  
    3.             string path = Application.StartupPath + "\\"+ "XMLFile1.xml";  
    4.             var doc = new XmlDataDocument();  
    5.             doc.Load(path);  
    6.             foreach (XmlNode node in doc.DocumentElement.ChildNodes)  
    7.             {  
    8.                 //string text = node.InnerText; or loop through its children as well  
    9.                 foreach (XmlNode cnode in node)  
    10.                 {  
    11.   
    12.                     string text = cnode.InnerText; //or loop through its children as well  
    13.                 }  
    14.             }  
    15.         }  
     
    0
  • Jignesh Kumar
    0
    Please find below link.
     
    http://www.drdobbs.com/windows/parsing-xml-files-in-net-using-c/184416669 
    0
  • Suman Raj
    0
    Laxmidhar Sahoo
     how about the xmlfile how can i write properties in XML
    0
  • Jignesh Kumar
    0
    Hi Suman,
     
    Please find below link for read and write operation
    https://www.c-sharpcorner.com/article/reading-and-writing-xml-in-C-Sharp/ 
    0
  • Suman Raj
    0
    Laxmidhar Sahoo
     
    var value = data.FirstOrDefault(v => v.Attribute("id").Value == textbox.Name.Replace("txt", "").ToLower());
     
    ///Can U explain this line
    0