title: How can I populate ASP:treeview with database query, only child populate? c# (WEB)
body: <p>How can i populate asp:treeview only child populate with database query like "Select Database_Name from database where user_id='1' and show these database in child treeview.Here is image
  <a href="http://i.stack.imgur.com/96Idk.png" rel="nofollow">image</a></p>
  
  <p>I want "Database" remain same and blow child "Database Name",,only 1st 3 records replace with "Database Name" shown just,Kindly tell me how can i do this,Thanks.I search on google but i can't find solution.Here is my db pic 
  <a href="http://i.stack.imgur.com/dK5cm.png" rel="nofollow">dbimage</a>.
  Here i try : </p>
  
  <pre><code>       SqlConnection cnn=new SqlConnection("Data Source=HAMEED_KHAN\\SQLEXPRESS;Initial Catalog=db_compiler;Integrated Security=True");
  
  protected void Page_Load(object sender, EventArgs e)
  {
  }
  
  protected void PopulateTreeView(object sender, EventArgs e)
  {   
   SqlCommand cmd=new SqlCommand("SELECT Database_Name FROM  Create_db",cnn);
  DataTable dt=new DataTable();
  Master.FindControl("TreeView1");
      TreeView tv = (TreeView)Master.FindControl("TreeView1");
  TreeNodeCollection parentNode = tv.Nodes;
   SqlDataAdapter da=new SqlDataAdapter(cmd);
   da.Fill(dt);
   PopulateTreeView(parentNode,0, dt);// error come at parent node
  }
  </code></pre>
  
  <p>Here is my aspx  </p>
  
  <pre><code>     &lt;asp:TreeView ID="TreeView1" runat="server" ImageSet="Arrows" 
                      Font-Size="Larger" onselectednodechanged="TreeView1_SelectedNodeChanged"&gt;
                      &lt;HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" /&gt;
                      &lt;Nodes&gt;
                          &lt;asp:TreeNode Text="Database" Value="Database"&gt;
                              &lt;asp:TreeNode  Text="Database Name" Value="Database Name"&gt;&lt;/asp:TreeNode&gt;
                              &lt;asp:TreeNode Text="Database Name" Value="Database Name"&gt;&lt;/asp:TreeNode&gt;
                              &lt;asp:TreeNode Text="Database Name" Value="Database Name"&gt;&lt;/asp:TreeNode&gt;
                              &lt;asp:TreeNode Text="More" Value="Database Name"&gt;&lt;/asp:TreeNode&gt;
                          &lt;/asp:TreeNode&gt;
                      &lt;/Nodes&gt;
                      &lt;NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" 
                          HorizontalPadding="5px" NodeSpacing="0px" VerticalPadding="0px" /&gt;
                      &lt;ParentNodeStyle Font-Bold="False" /&gt;
                      &lt;SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" 
                          HorizontalPadding="0px" VerticalPadding="0px" /&gt;
                  &lt;/asp:TreeView&gt;
  </code></pre>