Hi,
I am working on tree View in taht i want to do two thinks i.e
1. add new node at run time
2. what data is stored in a database is shown in the tree view as parent node and
its child
for second i have do some coding it shows data as parent and child node but problem is it shows only one row record can any one help me correct the coding please
SqlConnection con = new SqlConnection("USER=userid;PASSWORD=password;SERVER=servername;DATABASE=database");
string SQLQuery;
SQLQuery = "select tablename,displayname from Tablename";
DataSet ds=new DataSet();
SqlDataAdapter da=new SqlDataAdapter(SQLQuery,con);
da.Fill(ds);
foreach ( DataRow Row in ds.Tables[0].Rows)
{
TreeNode Tnode = new TreeNode("ParentNode");
treeView1.Nodes.Add(Tnode);
}
Thanks.....