title: How to read an xml subnode into ASP.NET repeater
body: <p>I am reading XML using xmlreader, and then binding the xml to a Repeater</p>
  
  <p>Here's the code behind:</p>
  
  <pre><code>            XmlReaderSettings settings = new XmlReaderSettings();
          settings.ProhibitDtd = false;
  
          XmlReader xmlData = XmlReader.Create(webClient.OpenRead(requestUrl), settings);
  
          try
          {
              xmlData.ReadToFollowing("SearchResults");
              Label1.Text = xmlData.GetAttribute("TotalCount");
              int numberResults = Convert.ToInt32(xmlData.GetAttribute("TotalCount"));
              if (numberResults &gt; 0)
              {
                  DataSet ds = new DataSet();
                  ds.ReadXml(xmlData);
                  Repeater1.DataSource = ds.Tables[1];
                  Repeater1.DataBind();
              }
              else
              {
                  Repeater1.DataSource = null;
                  Repeater1.DataBind();
              }
          }
  </code></pre>
  
  <p>Here's the repeater</p>
  
  <pre><code>        &lt;asp:Repeater ID="Repeater1" runat="server"&gt;
      &lt;HeaderTemplate&gt;&lt;b&gt;Results&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/HeaderTemplate&gt;
      &lt;ItemTemplate&gt;
     &lt;a href="&lt;%#DataBinder.Eval(Container.DataItem, "Url")%&gt;"&gt;
      &lt;%#DataBinder.Eval(Container.DataItem, "Title")%&gt;&lt;/a&gt;&lt;br /&gt;
      &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>And the xml looks like:</p>
  
  <pre><code>  &lt;SearchResults PageSize="1" PageIndex="0" TotalCount="155"&gt;
  &lt;SearchResult&gt;
    &lt;ContentId&gt;2458&lt;/ContentId&gt;
    &lt;Title&gt;Component description&lt;/Title&gt;
    &lt;Url&gt;http://whatever/19/p/1537/2458.aspx&lt;/Url&gt;
    &lt;Date&gt;2009-06-10T09:34:00+01:00&lt;/Date&gt;
    &lt;ContentType&gt;forum&lt;/ContentType&gt;
    &lt;Tags&gt;
      &lt;Tag&gt;Component&lt;/Tag&gt;
    &lt;/Tags&gt;
    &lt;Users&gt;
      &lt;User&gt;
        &lt;Id&gt;2533&lt;/Id&gt;
        &lt;DisplayName&gt;Haubent&lt;/DisplayName&gt;
        &lt;Username&gt;Haubent&lt;/Username&gt;
      &lt;/User&gt;
    &lt;/Users&gt;
    &lt;IndexedAt&gt;2010-07-29T15:40:52.414+01:00&lt;/IndexedAt&gt;
  &lt;/SearchResult&gt;
  </code></pre>
  
  <p></p>
  
  <p>So far so good.</p>
  
  <p>But - I want to be able to show the contents of the DisplayName node in my repeater item template. </p>
  
  <p>I tried</p>
  
  <pre><code>&lt;%#DataBinder.Eval(Container.DataItem, "DisplayName")%&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;%#DataBinder.Eval(Container.DataItem, "Users.User.DisplayName")%&gt;
  </code></pre>
  
  <p>but I get an error:</p>
  
  <blockquote>
    <p>System.Web.HttpException: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Users'.</p>
  </blockquote>
  
  <p>How to get at the DisplayName? </p>