开发者

how to get hirearchy xml throug linq

i want to generate the f开发者_如何学编程ollowing xml through linq

<Items EntityTypeId="1" name="Organization">
  <Items id="2" name="Managment Team">
    <Items id="3" name="CEO">
      <Items id="6" name="VP Tech" />
    </Items>
    <Items id="4" name="CFO">
      <Items id="7" name="VP finance" />
    </Items>
    <Items id="5" name="CTO" />
  </Items>
</Items>

i have a list of data with id and their parent id. can anyone help me?


Check out this article it should point you in the right direction. http://www.hookedonlinq.com/LINQtoXML5MinuteOverview.ashx

Remember you'll need to add a reference to your project System.Xml.Linq

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜