c.columns.add("pass",typeof(string))
foreach(DataRow dr1 in a.rows)
{
DataRow [] dtemp = b.select("pass="+dr1["pass"].tostring())
if(dtemp.Length>0)
{
DataRow drNew = c.NewRow()
drNew ["pass"] = dtemp[0]["pass"]
c.rows.add(drnew)
}
}
dataGridView.source = c//此处根据实际需求来
//未经测试,大概思路吧,你也可以不用b.select,b表也用foreach(),如
foreach(DataRow dr1 in a.rows)
{
foreach(DataRow dr2 in b.rows){
// do something
}
}
UPDATE aps_tailor_instruction_detail_rec o, (SELECT a.tailorAssemblyLineId,a.tailorAssemblyLineCode,a.deptId,c.name tailorAssemblyLineName,b.id productionSubPlanDetailId,a.id productionSubPlanId,a.planNumber
FROM aps_production_sub_plan a,aps_production_sub_plan_detail b,md_tailor_assembly_line c WHERE a.id=b.productionSubPlanId AND a.tailorAssemblyLineId=c.id
AND b.id=79751 AND a.factoryId=46 AND a.disabled=0) n
SET o.tailorAssemblyLineId = n.tailorAssemblyLineId, o.tailorAssemblyLineCode = n.tailorAssemblyLineCode,o.deptId = n.deptId,o.tailorAssemblyLineName = n.tailorAssemblyLineName,
o.productionSubPlanId=n.productionSubPlanId,o.subPlanNumber=n.planNumber,o.productionSubPlanDetailId=n.productionSubPlanDetailId
WHERE instructionNumber IN ('CZ22010136','CZ22010137','CZ22010140') AND factoryId=46 AND disabled=0 AND size='170/92A'
AND o.productionSubPlanId=5572
意思:判断 FGH列数据,在左边数据是否存在?
如果不存在,就把新的数据,写到数据库最后1行?
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)