以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  表达式列提示 只读  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=93269)

--  作者:kao_go
--  发布时间:2016/11/24 11:53:00
--  表达式列提示 只读
表达式列提示只读,,不知道问题在哪里

Dim zk As Decimal = fckzb.Current("zk")   
e.Form.Text=e.Form.Text+spdm+spmc    \'设置窗口标题
Dim shang As Table=Tables(ckmc+"_shang")


\'先生成商品明细,在把数量明细插入进去
\'生成数据表,临时表并且绑定
Dim taba,tab As String
Dim a1 As String = "select a.spdm,a.spmc,a.spsj1 as lsj," & zk & " As zk,b.ggdm As gg1dm,c.ggmc As gg1mc,d.ggdm As gg2dm,e.ggmc As gg2mc fr  om shangpin As a"
Dim a2 As String = " left outer join spgg1mx b on a.spdm=b.spdm"
Dim a3 As String = " left outer join guige1 c on b.ggdm=c.ggdm"
Dim a4 As String = " left outer join spgg2mx d on a.spdm=d.spdm"
Dim a5 As String = " left outer join guige2 e on d.ggdm=e.ggdm"
Dim a6 As String = " where a.spdm=\'" & spdm & "\'"
taba="("+a1+a2+a3+a4+a5+a6+")"
tab="select * fr  om " & taba & " as a order by gg1dm,gg2dm"
shang.Fill(tab,"zbh",True)
shang.DataTable.DataCols.add("sl",Gettype(Decimal)) \'动态增加数量列
shang.DataTable.DataCols.add("dj",Gettype(Double),"isnull([lsj],0)*isnull([zk],0)") \'动态增加单价
shang.DataTable.DataCols.add("je",Gettype(Double),"isnull([sl],0)*isnull([lsj],0)*isnull([zk],0)") \'动态增加金额
shang.DataTable.DataCols.add("bz",Gettype(String)) \'动态增加备注

图片点击可在新窗口打开查看此主题相关图片如下:只读列.jpg
图片点击可在新窗口打开查看




--  作者:有点蓝
--  发布时间:2016/11/24 12:05:00
--  
增加的临时列是表达式列,不能更改和填充这列的数据
--  作者:有点青
--  发布时间:2016/11/24 12:16:00
--  
 表达式列,是不能直接写入数据的。只有数据列可以