这是初始化资源管理器 0,1表示图片的索引 用到了 imagelist
DataTable ds
string strsql = "select id,name from hospital order by number"
SqlDB db = new SqlDB()
ds = db.FillDt(strsql)
// hosid = Convert.ToInt32(ds.Rows[0]["id"])
foreach (DataRow dr in ds.Rows)
{
TreeNode newNode = new TreeNode(dr[1].ToString(),0,1)
TV.Nodes.Add(newNode)
DataTable dy
string strql = "select id,name from department where hosId=" + dr[0].ToString() + " order by number"
dy = db.FillDt(strql)
foreach (DataRow du in dy.Rows)
{
TreeNode Node = new TreeNode(du[1].ToString(), 0, 1)
newNode.Nodes.Add(Node)
DataTable dq
string strl = "select * from doctor where depId=" + du[0].ToString() + "order by number"
dq = db.FillDt(strl)
foreach (DataRow dm in dq.Rows)
{
TreeNode Nde = new TreeNode(dm[2].ToString(), 0, 1)
Node.Nodes.Add(Nde)
}
}
}