我可以再货物信息中看见东西,为什么传值到付款界面是没有显示我选中的货物名称
下面是我在货物信息里的代码 用来传值
private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
// 这个事件 是代表着 当这个行被选中后触发该 事件 下面的代码代表着 获得现在被选中的DataGridViewRow
DataGridViewRow dataRow = this.dataGridView1.SelectedRows[0];
string da =Convert.ToString(dataRow.Cells["g_id"]);
Form5.d = da;
}
这是我在付款界面里的绑定数据源的代码
private void Form5_Load(object sender, EventArgs e)
{
DataTable dt = dataBase.ExecuteDataTable("select * from T_goods where g_id=@d", new SqlParameter("d", d));
dataGridView1.DataSource = dt;
}