以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 这个代码怎么写?提示错误。 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=75289) |
-- 作者:yancheng -- 发布时间:2015/10/3 16:16:00 -- 这个代码怎么写?提示错误。 Dim Vals As List(of String()) Vals = DataTables("考勤").GetValues("合同编号|员工编号|考勤月份","审核 is null") For i As Integer = 0 To Vals.Count - 1 Dim tr As DataRow = DataTables("工资发放").Find("合同编号 = \'" & Vals(i)(0) & "\' And 员工编号 = \'" & Vals(i)(1) & "\' And 考勤月份 = \'" & Vals(i)(2) & "\'") If tr Is Nothing Then Dim dr As DataRow = DataTables("工资发放").AddNew() dr("合同编号") = Vals(i)(0) dr("员工编号") = Vals(i)(1) dr("考勤月份") = Vals(i)(2) End If 考勤月份 = \'" & Vals(i)(2) & "\'") 这个代码,怎么写好呢? [此贴子已经被作者于2015/10/3 16:27:28编辑过]
|
-- 作者:qianqian1530 -- 发布时间:2015/10/3 16:23:00 -- ("[合同编号] = \'" & Vals(i)(0) & "\' AndAlso [员工编号] = \'" & Vals(i)(1) & "\' AndAlso [考勤月份] = \'" & Vals(i)(2) & "\'") |
-- 作者:yancheng -- 发布时间:2015/10/3 16:28:00 -- 按你的写后,还是提示错误。麻烦看一下怎么写?谢谢。 |
-- 作者:大红袍 -- 发布时间:2015/10/4 10:53:00 -- Dim Vals As List(of String()) Vals = DataTables("考勤").GetValues("合同编号|员工编号|考勤月份","审核 is null") For i As Integer = 0 To Vals.Count - 1 Dim tr As DataRow = DataTables("工资发放").Find("合同编号 = \'" & Vals(i)(0) & "\' And 员工编号 = \'" & Vals(i)(1) & "\' And 考勤月份 = #" & Vals(i)(2) & "#") If tr Is Nothing Then Dim dr As DataRow = DataTables("工资发放").AddNew() dr("合同编号") = Vals(i)(0) dr("员工编号") = Vals(i)(1) dr("考勤月份") = Vals(i)(2) End If Next |