DataRelation设定的问题???
SqlCommand sqlCmd=new SqlCommand();
sqlCmd.CommandText="P_GetDutyTaskInfo";
sqlCmd.CommandType=CommandType.StoredProcedure ;
dsDutyTask=dataAccess.FillDataSetMasterDetail(dsDutyTask,sqlCmd,"HOD2DUTY","HOD2DUTY_D");
//MessageBox.Show(this.dsDutyTask.Tables[0].Rows[0][0].ToString());
//MessageBox.Show(this.dsDutyTask.Tables[1].Rows[2][0].ToString());
DataRelation duty_rel = dsDutyTask.Relations.Add("les",
this.dsDutyTask.Tables[0].Columns["ID_HOD2DUTY"],
this.dsDutyTask.Tables[1].Columns["ID_DUTY"]);
this.dataGridView1.DataSource = this.dsDutyTask.Tables[0];
this.dataGridView2.DataSource = this.dsDutyTask.Tables[1];
========================================================================
我设定好dataRelation后运行也没问题,
但是当我点DataGridView1中的一行时,Datagridview2中的数据并不会发生改变,为什么?