read xml file 'Hello world'
-
i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception. here's my code:
private void button1_Click(object sender, System.EventArgs e) { OpenFileDialog1.ShowDialog(); XmlNodeList nodeList; XmlDocument doc = new XmlDocument(); doc.LoadXml(OpenFileDialog1.FileName); XmlNode root = doc.DocumentElement; nodeList=root.SelectNodes("members"); foreach (XmlNode node in nodeList) { listBox1.Items.Add(node.Name); } }
please help, thanks, Rob -- There are 10 kinds of people. Those who understand binary and those who don't. -
i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception. here's my code:
private void button1_Click(object sender, System.EventArgs e) { OpenFileDialog1.ShowDialog(); XmlNodeList nodeList; XmlDocument doc = new XmlDocument(); doc.LoadXml(OpenFileDialog1.FileName); XmlNode root = doc.DocumentElement; nodeList=root.SelectNodes("members"); foreach (XmlNode node in nodeList) { listBox1.Items.Add(node.Name); } }
please help, thanks, Rob -- There are 10 kinds of people. Those who understand binary and those who don't.stupid thing posted when i hit the 'preview' button. here's the xml source: Newco.Controls Summary description for GroupBoxLine. Removes the 'FlatStyle' property for this item. Draws a light dashed line around the control in design view to make it more visible. Custom control to mirror the look of an Office 2003 groupBox. Specifies the color of the line. Specifies the color of the text. Default contructor for the class GroupBoxLine. Overrides the OnPaint event to create the look of Office 2003. Clean up any resources being used. Specifies the color of the line. Specifies the color of the text.
-
i'm new to xml and i'm using the hlep files trying to read an xml document but i can't get it to work. everytime it tries to access anything in the xmldoc it errors with an unhandled exception. here's my code:
private void button1_Click(object sender, System.EventArgs e) { OpenFileDialog1.ShowDialog(); XmlNodeList nodeList; XmlDocument doc = new XmlDocument(); doc.LoadXml(OpenFileDialog1.FileName); XmlNode root = doc.DocumentElement; nodeList=root.SelectNodes("members"); foreach (XmlNode node in nodeList) { listBox1.Items.Add(node.Name); } }
please help, thanks, Rob -- There are 10 kinds of people. Those who understand binary and those who don't.LoadXml
expects the string to be the XML you should be usingLoad(filename)
"When the only tool you have is a hammer, a sore thumb you will have."