I am trying to parse this xml file http://feeds.bbci.co.uk/news/world/rss.xml into a ListBox in visual C#, I tried a lot of different methods none of them worked, this is the one that kind of works:
XElement element = XElement.Load("http://feeds.bbci.co.uk/news/world/rss.xml");
foreach (XElement item in element.Elements("channel")) {
listBox1.Items.Add(item.Value);
}
the only problem is, it loads the wrong object and if I set it to
XElement element = XElement.Load("http://feeds.bbci.co.uk/news/world/rss.xml");
foreach (XElement item in element.Elements("item")) {
listBox1.Items.Add(item.Value);
}
it loads nothing, what should i do?
itemtable as data source of your ListBox andtitleas display member.