以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  帮忙找找代码哪里错了~~  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=27274)

--  作者:temblar
--  发布时间:2012/12/27 12:17:00
--  帮忙找找代码哪里错了~~
找不到了 头晕了  通过datacolchanged 美金价格就是出不来,重置列没用...帮忙找找,谢谢

 If e.DataCol.Name = "合同价格" Then
    If e.DataRow.Isnull("合同价格") Then
        e.DataRow("美元价格") = Nothing
    Else
        Dim dr As DataRow
        If e.DataRow.IsNull("外贸合同时间") = False  Then
            dr = DataTables("汇率").Find("月份 = " & e.DataRow("外贸合同时间").month)
            If dr IsNot Nothing Then

                e.DataRow("美元价格") = e.DataRow("合同价格") * dr(e.DataRow("币种"))
            End If
        End If
    End If
End If



找到了。。上面代码可以了

出错的是:
e.DataRow("美元价格") = e.DataRow("合同价格") * dr(e.DataRow("币种"))
这一句本来我写的是:
dim jg as double = e.DataRow("合同价格")
dim mjg as double = e.DataRow("美元价格")
mjg = jg * dr(e.DataRow("币种"))
不执行。为什么呢


[此贴子已经被作者于2012-12-27 12:24:47编辑过]