loadMenu("1",TreeView1.Nodes[0].ChildNodes);
void loadMenu(string index,TreeNodeCollection nodes)
{
DataTable dt = db.getData("select * from menus where ParentNode = "+index);
string nodeid;
for (int i = 0; i < dt.Rows.Count; i++)
{
nodes.Add(new TreeNode(dt.Rows[i]["nodeName"].ToString()));
loadMenu(dt.Rows[i]["nodeid"].ToString(),nodes[i].ChildNodes);
}
}