For Each dr1 As DataRow In DataTables("表A").Select("[编码]=a1 and [名称].contains 城中") Dim dr2 As DataRow = DataTables("表B").AddNew() For Each dc As DataCol in DataTables("表A").DataCols dr2(dc.Name) = dr1(dc.name) Next Next
For Each dr1 As DataRow In DataTables("表A").Select("[编码]='a1' and [名称] Like '*城中*'") Dim dr2 As DataRow = DataTables("表B").AddNew() For Each dc As DataCol in DataTables("表A").DataCols dr2(dc.Name) = dr1(dc.name) Next Next
4楼
yangming 发表于:2010/2/28 23:47:00
这样更好! dim f As New Filler f.SourceTable = DataTables("表A") '指定数据来源 f.DataTable = DataTables("表B") '指定数据接收表 f.Filter ="[编码]='a1' and [名称] Like '*城中*'" f.Fill() '填充数据