My question is often called at many places, but I have XML, without attributes, so I can not use . My XML structure is:
& lt; Offer & gt; & Lt; Offer & gt; & Lt; Seller & gt; & Lt; Citizen & gt; & Lt; Name & gt; A name & lt; / Name & gt; & Lt; Id & gt; An ID & lt; / Id & gt; & Lt; / Citizen & gt; & Lt; / Vendor & gt; & Lt; Amount & gt; Number & lt; / Zodiac & gt; & Lt; Exchange rate & gt; Rate & lt; / Exchange rate & gt; & Lt; / Proposal & gt; . . . & Lt; Offer & gt; .... & lt; / Offer & gt; & Lt; / Offers & gt; I managed to populate a multicolumn list view with this code:
var Offer = Loaded from Elements ("Offer"). Select element ("proposal") o; Forex Currency (Veer vmi in Offer) {ListViewItem Item = New ListViewItem (); Item = list1 item. Add (vmi.Descendants ("name"). First (). Value); Item.SubItems.Add (vmi.Element ("zodiac") value.); Item.SubItems.Add (vmi.Element ("exchange rate") value.); } But now, let me first Can you please provide this code in C #? I tried Firstton (or earlier) but I got stuck. Thank you in advance! UPDATE! I forgot to state that the tag of citizen can be different in XML, it is a citizen or company, this is the reason why I have used the law of the countrymen but if you want to handle me in this way I can show a better way, I appreciate it. & lt; Offer & gt; & Lt; / Offer & gt; must select the data- (name, zodiac, exchange rate) / code>
var firstOffer = loaded Element ("Offer"). Element ("proposal"); Var name = firstOffer.Element ("Seller"). Element ("Citizen"). Element ("name"). Values; Var id = firstOffer.Element ("vendor"). Element ("Citizen"). Element ("id"). Values; Var zodiac = Firstoffice Element ("zodiac"). Values; Var Exchange Right = FirstOffer. Element ("exchange-rate"). Values;
Comments
Post a Comment