Dim tb1 As Table = Tables("列名表") '加载表 Dim tb2 As Table = Tables("开标标录") '加载表 Dim tb3 As Table = Tables("标录明细") '标录明细表 Dim dic As new Dictionary(of String, String) For Each dc As Col In tb2.Cols If dic.ContainsKey(dc.Caption) = False Then dic.Add(dc.Caption, dc.name) End If Next Dim dic1 As new Dictionary(of String, String) For Each r As Row In tb1.Rows If r("接收表列名") = Nothing Then dic1.add(dic(r("来源表列名")), dic(r("来源表列名"))) Else dic1.add(dic(r("来源表列名")), r("接收表列名")) End If Next For Each dr1 As DataRow In tb2.DataTable.Select("[投标企业] Is Not Null") Dim dr2 As Row = tb3.AddNew() For Each key As String In dic1.Keys If tb3.Cols.Contains(dic1(key)) Then dr2(dic1(key)) = dr1(key) End If Next Next
|