代码用的是线程josn 符合条件先装入 d1.Add("序列",val(rs("编号")))
d1.Add("序号",dr("序号").Tostring())
d1.Add("物料代码",dr("物料代码").Tostring())
d1.Add("编号",rs("编号").Tostring())
到了表格中再生成
Dim dirList2 As List(of Dictionary(Of String,String)) = JsonConvert.DeserializeObject(Of List(of Dictionary(Of String,String)) )(Vars("tbInfo2"))
' MessageBox.Show(dirList2.Count)
'Return ""
Dim ssr As String
Dim sts_s() As String = {"项目编号","序号","物料代码","名称","编号"}
For i As Integer=0 To dirList2.Count-1
st = ""
st1 = ""
st2 = ""
For Each c As String In sts_s
If dirList2(i).ContainsKey(c) = True Then
' r(c.name) = dirList2(i)(c.name)
If Vars("theadStartNum3") = theadStartNum Then
st1 = st1 & "," & c
ssr = dirList2(i)(c).Replace("'","''")
st2 = st2 & "','" & ssr
Else
Return ""
End If
End If
Next
st1 = st1.Trim(",")
st2 = st2.Trim("'",",")
If Vars("theadStartNum3") = theadStartNum Then
st = "Insert Into APQP基本资料信息 (" & st1 & ") values('" & st2 & "')"
'Output.Show(st1)
'Output.Show(st2)
'Output.Show(st)
cmd.CommandText = st
cmd.ExecuteNonQuery
Else
Return ""
End If
Next
此主题相关图片如下:{_6`nvb4qvi8vm%`h1uw302.jpg
此主题相关图片如下:5d7262dc07d1c6e7c8c0befe34f5a876_750_750.jpg