title: Loading a nested repeater with Data from 2 Entity Framework Queries
body: <p>I have 2 tables A and B that have a many to many relationship.  I am using nested repeaters to show the data in a web page.  My issue is, how do I write an ObjectQuery or an IQueryable query that returns the parent rows in A and the child rows in B so that I can use them as my data sources for my inner and out repeater.  I have the code I wrote so far below but I am not sure if it is correct or even close.</p>
  
  <pre><code>&lt;asp:Repeater ID="A" runat="server"&gt;&lt;br/&gt;
      &lt;ItemTemplate&gt;&lt;br/&gt;
          &lt;h2 class="Information"&gt;&lt;br/&gt;
              &lt;%# Eval("Name") %&gt; (&lt;%#Eval("Abbreviation")%&gt;)&lt;br/&gt;
          &lt;/h2&gt;&lt;br/&gt;
          &lt;hr/&gt;&lt;br/&gt;
          &lt;p&gt; &lt;%# Eval("Description")%&gt; &lt;/p&gt;&lt;br/&gt;
          &lt;asp:Repeater ID="B" runat="server"&gt;&lt;br/&gt;
              &lt;ItemTemplate&gt;&lt;br/&gt;
                  &lt;li&gt;&lt;br/&gt;
                      &lt;a href="..Pages/Category.aspx?&lt;%# Eval("ID") %&gt;"&gt;&lt;br/&gt;
                          &lt;%# Eval("Name") %&gt;&lt;br/&gt;
                      &lt;/a&gt;&lt;br/&gt;
                  &lt;/li&gt;                        &lt;br/&gt;
              &lt;/ItemTemplate&gt;&lt;br/&gt;
          &lt;/asp:Repeater&gt;&lt;br/&gt;
      &lt;/ItemTemplate&gt;&lt;br/&gt;
  &lt;/asp:Repeater&gt;      
  </code></pre>
  
  <p>This is my C# codebehind so far:</p>
  
  <pre><code>        using (DBEntities connection = new DBEntities())
          {
  
  
              ObjectQuery&lt;A&gt; As = connection.A;
              IQueryable&lt;A&gt; aQuery = from a in As
                                                 orderby a.SortOrder
                                                 select a;
  
  
              TechnologyRepeater.DataSource = As;
              DataBind();
          }
  </code></pre>