Foxtable(狐表)用户栏目专家坐堂 → [求助] 这个重置列的时候会报调用目标异常的错误 找不到原因了!


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

主题:[求助] 这个重置列的时候会报调用目标异常的错误 找不到原因了!

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


加好友 发短信
等级:三尾狐 帖子:714 积分:5207 威望:0 精华:0 注册:2012/4/13 13:10:00
[求助] 这个重置列的时候会报调用目标异常的错误 找不到原因了!  发帖心情 Post By:2013/6/1 19:12:00 [只看该作者]

找不到哪里的语法不对了……

 

Select Case e.DataCol.name
    Case "零件名称","零件号","生产工艺","工艺原料","仓库_入库确认","仓库_待发确认","仓库_原材料领料完成日"
        Dim dr As DataRow = e.DataRow
        If dr.Isnull("生产工艺") = False Then
            If dr("生产工艺") = "外购成品" OrElse dr("生产工艺") = "组件" OrElse dr("生产工艺") = "库存成品" Then
                Dim pf As String = dr("零件号")
                Dim cmd1 As New SQLCommand
                Dim cmd2 As New SQLCommand
                Dim cmd3 As New SQLCommand
                cmd1.C
                cmd2.C
                cmd3.C
                If pf > "" Then
                    cmd1.commandText = "Select [库存数量] From {库存总表} Where [零件号] = '" & pf & "'"
                    cmd2.commandText = "Select [待发数量] From {库存总表} Where [零件号] = '" & pf & "'"
                    cmd3.commandText = "Select [储位] From {库存总表} Where [零件号] = '" & pf & "'"
                End If
                dr("仓库_库位代码") = cmd3.ExecuteScalar & " 库存:" & cmd1.ExecuteScalar - cmd2.ExecuteScalar
            Else
                Dim pf As String = dr("工艺原料")
                Dim cmd1 As New SQLCommand
                Dim cmd2 As New SQLCommand
                Dim cmd3 As New SQLCommand
                cmd1.C
                cmd2.C
                cmd3.C
                If pf > "" Then
                    cmd1.commandText = "Select [库存数量] From {库存总表} Where [零件号] = '" & pf & "'"
                    cmd2.commandText = "Select [待发数量] From {库存总表} Where [零件号] = '" & pf & "'"
                    cmd3.commandText = "Select [储位] From {库存总表} Where [零件号] = '" & pf & "'"
                End If
                dr("仓库_库位代码") = cmd3.ExecuteScalar & " 库存:" & cmd1.ExecuteScalar - cmd2.ExecuteScalar
            End If
        End If
End Select


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


加好友 发短信
等级:管理员 帖子:47497 积分:251403 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2013/6/3 8:01:00 [只看该作者]

用这个分析一下,看看问题出在哪一行代码:

http://www.foxtable.com/help/topics/1485.htm

 


 回到顶部