Dim sa1 As String = "A01"
Dim fsc As String = "开piao数据"
Dim drU As DataRow
drU = DataTables("表C").Find("[执行编号] = '" & sa1 & "' And [分类] = '" & fsc & "'")
Dim dzml1 As String = drU("主文件夹目录")
Dim dzml2 As String = drU("次文件夹目录")
For Each f As String In FileSys.GetFiles(dzml2)
If f.EndsWith(".log") Then
Dim txt As String = FileSys.ReadAllText(f, Encoding.Default)
Dim idx As Integer = txt.IndexOf("<?xml version")
Dim idx2 As Integer = txt.IndexOf("</business>",idx)
Do While idx > -1 And idx2 > -1
Dim s2 As String = txt.SubString(idx,idx2-idx+11)
idx = txt.IndexOf("<?xml version",idx2)
If idx > -1
idx2 = txt.IndexOf("</business>",idx)
Else
idx2=-1
End If
Dim xmlDoc As New System.XML.XmlDocument
xmlDoc.Loadxml(s2)
Dim ndList = xmlDoc.GetElementsByTagName("comment")
For Each dr As object In ndlist
Dim fpdm As String
Dim fphm As String
Dim ghdwmc As String
Dim ghdwdzdh As String
Dim ghdwsbh As String
Dim ghdwyhzh As String
Dim hjje As String
Dim hjse As String
Dim jshj As String
Dim bz As String
For i As Integer = 0 To ndList.count - 1
If ndList(i).Item("fpdm") IsNot Nothing Then fpdm = ndList(i).Item("fpdm").InnerText
If ndList(i).Item("fphm") IsNot Nothing Then fphm = ndList(i).Item("fphm").InnerText
If ndList(i).Item("ghdwmc") IsNot Nothing Then ghdwmc = ndList(i).Item("ghdwmc").InnerText
If ndList(i).Item("ghdwdzdh") IsNot Nothing Then ghdwdzdh = ndList(i).Item("ghdwdzdh").InnerText
If ndList(i).Item("ghdwsbh") IsNot Nothing Then ghdwsbh = ndList(i).Item("ghdwsbh").InnerText
If ndList(i).Item("ghdwyhzh") IsNot Nothing Then ghdwyhzh = ndList(i).Item("ghdwyhzh").InnerText
If ndList(i).Item("hjje") IsNot Nothing Then hjje = ndList(i).Item("hjje").InnerText
If ndList(i).Item("hjse") IsNot Nothing Then hjse = ndList(i).Item("hjse").InnerText
If ndList(i).Item("jshj") IsNot Nothing Then jshj = ndList(i).Item("jshj").InnerText
If ndList(i).Item("bz") IsNot Nothing Then bz = ndList(i).Item("bz").InnerText
Next
Dim ndList1 = xmlDoc.GetElementsByTagName("fyxm")(0).ChildNodes
For i As Integer = 0 To ndList.count - 1
Dim spmc As String = ndList1(i).Item("spmc").InnerText
Dim ggxh As String = ndList1(i).Item("ggxh").InnerText
Dim sl As String = ndList1(i).Item("sl").InnerText
Dim se As String = ndList1(i).Item("se").InnerText
Dim dw As String = ndList1(i).Item("dw").InnerText
Dim spsl As String = ndList1(i).Item("spsl").InnerText
Dim dj As String = ndList1(i).Item("dj").InnerText
Dim je As String = ndList1(i).Item("je").InnerText
Dim r As Row = Tables("表B").AddNew
r("第一列") = fpdm
r("第二列") = fphm
r("第三列") = ghdwmc
r("第四列") = spmc
r("第五列") = ggxh
r("第六列") = dw
r("第七列") = spsl
r("第八列") = dj
r("第十列") = "str"
Next
Next
Loop
End If
Next
错误是没有了,但是没有将数据写入表中,这是为什么?