Foxtable(狐表)用户栏目专家坐堂 → SQLUpdate无法更新,参数3错误


  共有2088人关注过本帖平板打印复制链接

主题:SQLUpdate无法更新,参数3错误

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


加好友 发短信
等级:幼狐 帖子:103 积分:1081 威望:0 精华:0 注册:2017/11/14 13:43:00
SQLUpdate无法更新,参数3错误  发帖心情 Post By:2019/11/21 14:46:00 [只看该作者]

For Each dr As DataRow In DataTables(bm).DataRows
    Dim srs As New List(of DataRow) 
    srs = DataTables("Test").SQLSelect("年月 = '" & dr("年月") & "' and 仓库名称 = '" & dr("仓库名称") & "' and 存货名称 = '" & dr("存货名称") & "'")
    If srs.Count>1 Then        
        Dim sum As Double = Math.Round(DataTables("Test").Compute("Sum(成本金额)","年月 = '" & dr("年月") & "' and 仓库名称 = '" & dr("仓库名称") & "' and 存货名称 = '" & dr("存货名称") & "'"),4)
        For Each sr As DataRow In srs
            sr("调拨差异") =  Math.Round(sr("调拨差异") + Math.Round(dr("差异金额") * (sr("成本金额")/sum), 2),2)
            sr("实际成本") = sr("成本金额") + sr("调拨差异")
        Next
    DataTables("Test").SQLUpdate(srs)
    End If  
Next


传入的表格格式数据流(TDS)远程过程调用(RPC)协议流不正确。参数 3 (""): 提供的值不是数据类型 float 的有效实例。请检查源数据中的无效值。例如,小数位数大于精度的数值类型的数据即为无效值。


老师,这个错误怎么原因是什么呢?我用了 Math.Round去除了小数位,也不行,求解

 回到顶部