关于treeview数据传递问题
if (treeView1.SelectedNode.Name .Length == 4){
SqlConnection conn = new SqlConnection("server=.;database=人事管理;uid=sa;pwd=230415;");
conn.Open();
string yg_id;
if (ds.Tables["ygbumen"] != null)
ds.Tables["ygbumen"].Clear();
yg_id = "'" + treeView1.SelectedNode.Name + "'";
SqlDataAdapter sda = new SqlDataAdapter("exec Get_ygbumenInfo '" + yg_id + "'", conn);
sda.Fill(ds, "ygbumen");
this.dataGridView1.DataSource = sql.ds.Tables["ygbumen"].Rows[4]["ygbumen"].ToString();
}
这个是我在treeview中写的数据传递代码,但运行后,选中那个子节点,信息不会在gridview中显示,什么地方错了呢