Dim dt As DataTable Dim dtb As New DataTableBuilder("统计") dtb.AddDef("产品", Gettype(String), 16) dt = dtb.Build() Dim sdt As DataTable = DataTables("表A") For Each cp As String In sdt.GetValues("产品") Dim ndr As DataRow = dt.AddNew ndr("产品") = cp For Each dr As DataRow In sdt.Select("产品 = '" & cp & "'") Dim qxs() As String = dr("缺陷").Split(",") For Each qx As String In qxs If dt.DataCols.Contains(qx) = False Then dt.DataCols.Add(qx, Gettype(Integer)) End If ndr(qx) += 1 Next Next Next
|