在运行以下代码时候,出现问题,已经查到之是这个问题但不知道应该如何修改:
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.1.12.18
错误所在事件:
详细错误信息:
对于造型说明无效的字符值
For p As Integer = 0 To tCols.Length -1
fr(tCols(p)) = dr(tCols(p))
Next
完整代码为:
Dim i As Integer
Dim o As Integer
Dim f As Integer
Dim prb As WinForm.ProgressBar = e.Form.Controls("ProgressBar1")
Dim sCols() As String = {"日期","时间","工号尾数","体温","工号","姓名","记录人","复工日期","体温监测点","监测时间段","年月","日","考勤班次"}
Dim tCols() As String = {"时间","工号尾数","体温","姓名","记录人","复工日期","体温监测点","监测时间段","年月","日"}
prb.Visible = True
prb.Maximum = DataTables("体温签到数据").Compute("Count(工号)","是否上传 = False")
For Each dr As Row In Tables("体温签到数据").Rows
If dr("是否上传") = False Then
Dim fr As DataRow = DataTables("H_BackManList").SQLFind("工号 = '"& dr("工号") &"' And 考勤班次 = '"& dr("考勤班次") &"' And 日期 = '"& dr("日期") &"'")
If fr Is Nothing Then
MessageBox.Show("C")
Dim nr As DataRow = DataTables("H_BackManList").AddNew
For l As Integer = 0 To sCols.Length -1
nr(sCols(l)) = dr(sCols(l))
Next
nr("上传时间") = DateTime.Now
nr.Save
o = o + 1
Else
MessageBox.Show("D")
For p As Integer = 0 To tCols.Length -1
fr(tCols(p)) = dr(tCols(p))
Next
fr("上传时间") = DateTime.Now
fr.Save
f = f + 1
End If
i = i + 1
prb.Value = i
dr("是否上传") = True
dr.save
End If
Next
MessageBox.Show("体温数据已上传,其中新数据" & o & "个,覆盖原数据" & f & "个","温馨提示")