string data=<item><name>pradeep</name></item> XmlDocument doc = new XmlDocument(); doc.LoadXml(data);
string data = "<item><name>pradeep</name></item>"; XmlDocument xmlDoc = new XmlDocument(); //XmlDocument won't parse the string data as XmlDeclaration is missing. Hence below is the correct xml format. string completeXML = "<?xml version=\"1.0\"?>" + data; xmlDoc.LoadXml(completeXML); //using XPath expression to get to the name node string xPath = "/item/name"; XmlNode node = xmlDoc.SelectSingleNode(xPath); textBox1.Text = node.InnerText;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)