-- 作者:大红袍
-- 发布时间:2015/9/15 19:23:00
--
mark 查询与赋值
Dim tdic As new Dictionary(of DataRow, DataRow) Dim tls As new List(of DataRow)
Dim i As Integer For i = 0 To DataTables("零件工艺").DataRows.Count-1 Dim dr As DataRow = DataTables("零件工艺").DataRows(i) Dim dr2 As DataRow = DataTables("零件工艺").Find("图号=\'" & dr("图号") & "\' and 计件工序=\'" & dr("计件工序") & "\' and _Identify <> " & dr("_Identify")) If dr2 IsNot Nothing Then tdic.add(dr2, dr) Else tls.Add(dr) End If Next
For Each key As DataRow In tdic.Keys For Each dc As DataCol In DataTables("重复工序零件工艺").DataCols key(dc.Name) = tdic(key)(dc.Name) Next Next For Each dr As DataRow In tls Dim ndr As DataRow = DataTables("重复工序零件工艺").AddNew For Each dc As DataCol In DataTables("重复工序零件工艺").DataCols ndr(dc.Name) = dr(dc.Name) Next Next
|