0
Good afternoon,
I’d like to know how to add the values of an xml array to a Combox.
I am using this code but it is giving me the following error: "System.Collections.Arraylist" in the Combox
c#:
private void Form1_Load(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load("C:\\Work\\tip.xml");
ArrayList list = new ArrayList();
XmlNode idNodes = doc.SelectSingleNode("colors/color");
foreach (XmlNode node1 in idNodes.ChildNodes)
list.Add(node1.InnerText);
comboBox1.Text = list.ToString();
}
XML:
<colors>
<color>
<c1>Black</c1>
<c2>Yellow</c2>
<c3>White</c3>
</color>
</colors>
thanks was just that. I’ve been chasing this hiccup for a long time.
– Cesar Goulart