Hi, all
am using asp.net 2.0, c#
i have a tree view control
from two tables i have to add nodes dynamically
i hav category(cat_id ,cat_name),
sub category(sub_ca t_id,cat_id,sub _cat_name) tables
under category node i have to fill subcategory names as child node
using above code i filled parent nodes
how to get child nodes?
please help me
Thankyou
am using asp.net 2.0, c#
i have a tree view control
from two tables i have to add nodes dynamically
i hav category(cat_id ,cat_name),
sub category(sub_ca t_id,cat_id,sub _cat_name) tables
under category node i have to fill subcategory names as child node
Code:
con.Open()
cmd = New SqlCommand("select cat_id,cat_name from tbl_category order by cat_name", con)
dr = cmd.ExecuteReader()
While dr.Read()
cat = New TreeNode()
cat.Text = dr("cat_name").ToString
cat.Value = dr("cat_id").ToString
TreeView2.Nodes.Add(cat)
End While
dr.Close()
con.Close()
how to get child nodes?
please help me
Thankyou
Comment