以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 多值拆解的问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=85611) |
-- 作者:douglas738888 -- 发布时间:2016/5/30 11:27:00 -- 多值拆解的问题 请教老师,以下代码拆解多值字段时,只拆解了第一个名字,而且是重复的,第二、第三...个名字没有拆解,要实现的是多值里面的姓名每人一行 请老师帮忙看看
For i As Integer = 0 To DataTables("合同表").DataRows.Count-1 Dim dt As DataTable Dim lst As New Dictionary(of String ,DataRow) For Each dr As DataRow In DataTables("合同表").DataRows If dr.IsNull("审核人员") = False Then Dim nms() As String = dr("审核人员").Split(",") For Each nm As String In nms Dim r As Row = Tables("合同表.合同审核").AddNew r("审核人员") = nms(i) Next End If Next Next |
-- 作者:大红袍 -- 发布时间:2016/5/30 11:29:00 -- For i As Integer = 0 To DataTables("合同表").DataRows.Count-1 Dim dt As DataTable Dim lst As New Dictionary(of String ,DataRow) For Each dr As DataRow In DataTables("合同表").DataRows If dr.IsNull("审核人员") = False Then Dim nms() As String = dr("审核人员").Split(",") For Each nm As String In nms Dim r As Row = Tables("合同表.合同审核").AddNew r("审核人员") = nm Next End If Next Next |