以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  关联表的数据  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=90406)

--  作者:newsun2k
--  发布时间:2016/9/12 10:20:00
--  关联表的数据
    Dim dr As DataRow = DataTables("表A").sqlfind("编码 = \'" & Vars("_tsPassParameter1") & "\'")
    If dr Is Nothing Then
       
        drb.text = dr("折扣金额")
    end if

其中,折扣金额是表达式列,从关联表中取值。
结果,报错误,折扣金额不存在。
怎么处理?

--  作者:有点蓝
--  发布时间:2016/9/12 10:32:00
--  
Dim dr As DataRow = DataTables("表A").sqlfind("编码 = \'" & Vars("_tsPassParameter1") & "\'")
    If dr Isnot Nothing Then
       
        drb.text = dr("折扣金额")
    end if

如果"折扣金额"不在表A,那就到有"折扣金额"的表查询