Foxtable(狐表)用户栏目专家坐堂 → 高效更新流水账


  共有1433人关注过本帖树形打印复制链接

主题:高效更新流水账

帅哥哟,离线,有人找我吗?
kaituozhe
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2234 积分:15278 威望:0 精华:0 注册:2015/7/18 10:10:00
高效更新流水账  发帖心情 Post By:2017/10/4 9:24:00 [只看该作者]

Dim nms As New List(Of String)
Dim drs As New List(of DataRow)
With DataTables("明细账")
    nms = .GetValues("科目编号|公司名称")
    For Each nm As String In nms '找出每个产品的第一行数据, 添加到集合drs中
        drs.Add(.Find("科目编号 = '" & nm(0) & "'and 公司名称 = '" & nm(1) & "'", "[_SortKey]"))
    Next
    For Each dr As DataRow In drs
        .DataCols("借方金额").RaiseDataColChanged(dr)
    Next

End With

以上高效更新流水账的代码,提示如下错误,应该怎么修改?

无法将类型为“System.Collections.Generic.List`1[System.String[]]”的对象强制转换为类型“System.Collections.Generic.List`1[System.String]”。

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106209 积分:540168 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/10/4 11:27:00 [只看该作者]

Dim nms As New List(Of String())
Dim drs As New List(of DataRow)
With DataTables("明细账")
    nms = .GetValues("科目编号|公司名称")
    For Each nm As String() In nms '找出每个产品的第一行数据, 添加到集合drs中
        drs.Add(.Find("科目编号 = '" & nm(0) & "'and 公司名称 = '" & nm(1) & "'", "[_SortKey]"))
    Next
    For Each dr As DataRow In drs
        .DataCols("借方金额").RaiseDataColChanged(dr)
    Next
End With

 回到顶部