TREEVIEW增加子节点
以用下面的增加了父节点,就是不知咋来把对应的子节点增加到父节点的下面string showtempstrsql = "SELECT * FROM JCSJ_WLLB WHERE WLLB_LBJS = '1'";
this.ds = wldq_ds.selectdatabase(showtempstrsql, showtablename);
//方法一:
//foreach(DataRow wllb_row in this.ds.Tables["JCSJ_WLLB"].Rows)
//{
// TreeNode wllb = new TreeNode();
// wllb.Text = wllb_row[1].ToString().Trim();
// wllb.Name = wllb_row[0].ToString().Trim();
// wllb_treeView.Nodes.Add(wllb);
//}
//方法二:
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
TreeNode wllb = new TreeNode();
wllb_row = ds.Tables[0].Rows[i];
wllb.Text = wllb_row[1].ToString().Trim();
wllb.Name = wllb_row[0].ToString().Trim();
wllb_treeView.Nodes.Add(wllb);
}