etwork Error (tcp_error)A communication error occurred: "Connection refused" The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.For assistance, contact your network support team. 贴个图上来看看啊DEMO
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.For assistance, contact your network support team. 贴个图上来看看啊DEMO
if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
{
DataRow[] drs = ds.Tables[0].Select("PurParentId=0"); //获取所有的父节点
for (int i = 0; i < drs.Length; i++)
{
TreeNode node = new TreeNode();
node.Text = drs[i]["PurName"].ToString();
node.Value = drs[i]["PurId"].ToString();
node.NavigateUrl = drs[i]["PurUrl"].ToString();
node.Target = "main";
DataRow[] childDrs = ds.Tables[0].Select("PurParentId=" + node.Value); //获得父节点下的所有子节点
for (int j = 0; j < childDrs.Length; j++)
{
TreeNode childnode = new TreeNode();
childnode.Text = childDrs[j]["PurName"].ToString();
childnode.Value = childDrs[j]["PurId"].ToString();
childnode.NavigateUrl = childDrs[j]["PurUrl"].ToString();
childnode.Target = "main";
node.ChildNodes.Add(childnode);
}
TreeView1.Nodes.Add(node);
}
}