'删除所有行
DataTables("表B").DataRows.Clear
DataTables("表B").ResumeRedraw
DataTables("表B").StopRedraw
Dim trv As WinForm.TreeView = e.form.Controls("TreeView2")
For Each nd As WinForm.TreeNode In trv.AllNodes
If nd.nodes.Count = 0 Then
Dim ary() As String = nd.FullPath.split(new Char() {"\", " "})
If ary.length = 6 Then
Dim ndr As DataRow = DataTables("表B").addnew
ndr("分类代码") = ary(0)
ndr("产品分类") = ary(1)
ndr("型号代码") = ary(2)
ndr("型号") = ary(3)
ndr("规格") = ary(4)
ndr("产品代码") = ary(5)
End If
End If
Next
DataTables("表B").ResumeRedraw