我有2个表:product
pid
主键和costs
pid
外键引用product.pid
DG -data adapter
DG.SelectCommand = new SqlCommand("Select * from costs where pid=@pid",con);
SqlParameter param= DG.SelectCommand.Parameters.Add(new SqlParameter("@pid", SqlDbType.Int, 4, "pid"));
param.SourceColumn = "pid"
param.SourceVersion = DataRowVersion.Original;
DG.Update(ds, "costs");
如果它使用param.SourceColumn = "pid"
中的costs
,我希望它从pid
表中获取product
,因为我希望这样可以获取所有子行cost
表。