What i would like to to is to pull out specific nodes like for example Weatherdata/Forecast/Tabular/ and then how to pull the data out from
so that i only get time = 2010-12-16
Would really appreciate any help or guidelines ! :)
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Dec 17, 2010, 8:45 AM EST
XDocument xDoc = XDocument.Load(Server.MapPath("Country.xml")); var xmlAtt = from att in xDoc.Elements("CountryList").Elements("Name") select att; foreach (var record in xmlAtt) { if (record.FirstAttribute.Value == "2") { comboBox1.Items.Add(record.Value); } } xDoc = null; xmlAtt = null;Mark the post as accepted answer
Suthish NairRank #92 · 22.8K reputationPosted Dec 16, 2010, 8:22 AM EST
using System.Collections.Generic; using System.Xml.Linq; using System.Linq;XDocument xmlDoc = XDocument.Load("C:/Users/Daxal/Desktop/example/VideoGames.xml"); var xmlAtt = from att in xmlDoc.Elements("Weatherdata/Forecast/Tabular/").Elements("time") select att; foreach (var record in xmlAtt) { //put breakpoint in record and check the value, according to that baind the records Split the value at "T" and get first array value. }Daniel Golan45 reputationPosted Dec 17, 2010, 8:15 AM EST
But when i use the combolist the values in the drop down is id="1" how can i filter away "id=" and only get the value ?
Second thing how can i then use the value (1) to open the corresponding xml data so by using the example the output to txtbox would be :
Name : Example
Platform: PC
xml example
Daniel Golan45 reputationPosted Dec 17, 2010, 8:55 AM EST
Since getting error "The name "response" does not exist in the current document"
Suthish NairRank #92 · 22.8K reputationPosted Dec 17, 2010, 9:01 AM EST
Daniel Golan45 reputationPosted Dec 17, 2010, 9:10 AM EST
How do i then use the example to populate a ComboList and when i choose one value can click a btn to get the xml data to a rich text box ?
Suthish NairRank #92 · 22.8K reputationPosted Dec 17, 2010, 9:19 AM EST
Daniel Golan45 reputationPosted Dec 17, 2010, 9:30 AM EST