回答編集履歴
1
修正
test
CHANGED
@@ -1 +1,69 @@
|
|
1
1
|
12まで続くプロパティの部分を別クラスにして、それでList作ったらどうでしょう。
|
2
|
+
|
3
|
+
例えば、
|
4
|
+
|
5
|
+
```vbnet
|
6
|
+
|
7
|
+
Class Hoge
|
8
|
+
|
9
|
+
Public Sub New(row As DataRow)
|
10
|
+
|
11
|
+
disp_color = row("disp_color").ToString
|
12
|
+
|
13
|
+
parts_no = row("parts_no").ToString
|
14
|
+
|
15
|
+
parts_name = row("parts_name").ToString
|
16
|
+
|
17
|
+
location_no = row("location_no").ToString
|
18
|
+
|
19
|
+
order_point = row("order_point").ToString
|
20
|
+
|
21
|
+
End Sub
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Public Property disp_color As String
|
26
|
+
|
27
|
+
Public Property parts_no As String
|
28
|
+
|
29
|
+
Public Property name As String
|
30
|
+
|
31
|
+
Public Property parts_name As String
|
32
|
+
|
33
|
+
Public Property location_no As String
|
34
|
+
|
35
|
+
Public Property order_point As String
|
36
|
+
|
37
|
+
End Class
|
38
|
+
|
39
|
+
```
|
40
|
+
|
41
|
+
こんなクラスを作って、
|
42
|
+
|
43
|
+
```vbnet
|
44
|
+
|
45
|
+
settingDto = New RPT_0060SettingDto
|
46
|
+
|
47
|
+
dtoList.Add(settingDto)
|
48
|
+
|
49
|
+
For Each row As DataRow In table.Rows
|
50
|
+
|
51
|
+
If settingDto.HogeList.Count = 12 Then
|
52
|
+
|
53
|
+
settingDto = New RPT_0060SettingDto
|
54
|
+
|
55
|
+
dtoList.Add(settingDto)
|
56
|
+
|
57
|
+
End If
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
settingDto.HogeList.Add(New Hoge(row))
|
62
|
+
|
63
|
+
Next
|
64
|
+
|
65
|
+
```
|
66
|
+
|
67
|
+
こんな感じのループにすると、HogeListが12個溜まった次のループでdtoListが追加されます。
|
68
|
+
|
69
|
+
(適当に考えたので、デバッグはしてないです)
|