void TreeViewBind(DataTable dt, string ParentID, TreeNode PNode)
{
DataRow[] dr=table.Select("ParentID=" + ParentID);
if (dr.Length > 0)
{
foreach (DataRow d in dr)
{
TreeNode TNode = new TreeNode();
TNode.Text = d["powerNAME"].ToString();
if (PNode == null)
{
this.TreeView1.Nodes.Add(TNode);
}
else
{
PNode.ChildNodes.Add(TNode);
}
TNode.NavigateUrl = d["name"].ToString();
TreeViewBind(dt, d["powerID"].ToString(), TNode);
}
}
}