load complex class/nested xml file into dataset

Posted by iTayb on Stack Overflow See other posts from Stack Overflow or by iTayb
Published on 2010-03-30T10:48:46Z Indexed on 2010/03/30 10:53 UTC
Read the original article Hit count: 317

Filed under:
|

I want to create a dataset and bind it with a repeater. My datasource is a class, which is itself loaded from an nested xml file. I can use both as datasources. How can I do it?

This is my sample XML file:

    <?xml version="1.0" encoding="utf-8"?>
    <BookStore xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <Book>
        <Name>??????? ????? 035006</Name>
        <Imageurl>math1.jpg</Imageurl>
        <Subject>???????</Subject>
        <Author>??? ????</Author>
        <Level>5</Level>
        <Year>2002</Year>
        <Rating>4</Rating>
        <BookSellers>
          <string>????? ?????</string>
          <string>?.?. ????? ??"?</string>
          <string>??? ?? ???? ????? ??????? ??"?</string>
          <string>?? ?????? ???? ?'????</string>
          <string>???? ??? ?????</string>
          <string>Garbage Collector</string>
          <string>???? ??????? ??????</string>
        </BookSellers>
        <BookPrices>
          <double>25</double>
          <double>48</double>
          <double>37</double>
          <double>52</double>
          <double>34</double>
          <double>22</double>
          <double>60</double>
        </BookPrices>
      </Book>

</BookStore>

Plus, how will I refer to this data? for example, DataBinder.Eval(Container.DataItem, "Imageurl" will bring me the url?

Thank you very much!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET