title: How to use linq with datatable and bind to the repeater in asp.net
body: <p>I am trying to create a menu using linq. I am getting all menu items in dataset. I would like to show like this:</p>
  
  <pre><code>Main Menu Item 1
  -Sub Menu
  -Sub Menu
  Main Menu Item 2
  -Sub Menu
  -Sub Menu
  </code></pre>
  
  <p>How can i use linq to sort data like this? All data stored in dataset. I want to show filtered data  in repeater.</p>
  
  <p>Note: Main Menu Items have: parent_menu_id='0'</p>
  
  <pre><code>&lt;ul&gt;
  &lt;asp:Repeater runat="trepeat" runat="server"&gt;
    &lt;ItemTemplate&gt;
       &lt;li&gt;
         &lt;a href="&lt;%# Eval("url") %&gt;"&gt;&lt;%# Eval("menu_name") %&gt;&lt;/a&gt;
         &lt;ul&gt;
           &lt;li&gt;
               &lt;a href="&lt;%# Eval("url") %&gt;"&gt;&lt;%# Eval("menu_name") %&gt;&lt;/a&gt;
           &lt;/li&gt;
         &lt;/ul&gt;
       &lt;/li&gt;
    &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  &lt;/ul&gt;
  </code></pre>