请教一下c#点一个树节点怎把值传给dataGridView1
如果是传值给textBox,可以这样写,
string sql = string.Format("select price,color,products_name from products where tid=" + e.Node.Tag, conn);
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader cd = cmd.ExecuteReader();
while (cd.Read())
{
this.textBox2.Text = cd[0].ToString();
this.textBox3.Text = cd[1].ToString();this.textBox4.Text = cd[2].ToString();
但是dataGridView1的怎写呢?