<string xmlns="http://www.webserviceX.NET"><NewDataSet> <Table> <code>91</code> <name>India</name> </Table> <Table> <code>91</code> <name>India</name> </Table> </NewDataSet></string>.
//Reading the XML file, Xread is a XML reader object while (xRead.Read()) { XmlNodeType nodeType = xRead.NodeType; if (nodeType == XmlNodeType.Element) { if ((xRead.Name == "graphic") || (xRead.Name == "inline-graphic")) { lintImageCount += 1; if (xRead.HasAttributes) { xRead.MoveToAttribute(0); strImagename = xRead.Value; blnOk = FileCheck(strImagename); if (blnOk == false) { break; } } } } } }
System.ArgumentException: Illegal characters in path. Line 27: XmlReader r = XmlReader.Create(code);Line 28:while (r.Read())
//getElementByTagName returns us NodeListXMLNodeList Xnlist = document.getElementByTagName("Table")for each (XmlNode XN in Xnlist.Nodes ){ //here we get value as 91 only. MessageBox.Show(XN.ChildsNodes[0].InnerText); }
private void PopulateXMLData(string id) { try { string XMLFilePath = System.Configuration.ConfigurationManager.AppSettings["XMLFileName"]; DataSet ds = new DataSet(); ds.ReadXml(XMLFilePath); foreach (DataRow dr in ds.Tables[0].Rows) { if ((dr["code"].ToString()) == id.ToString()) { txtCountryName.Text = dr["Name"].ToString().Trim(); //Continue for all fields.... } } } catch (Exception ex) { lblMsg.Text = "Error while fetching the record" + ex.Message; }