以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  getchildRows是获得加载数据还是所有后台数据?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=63731)

--  作者:wh420
--  发布时间:2015/1/27 13:21:00
--  getchildRows是获得加载数据还是所有后台数据?
e.DataRow.GetChildRows("订单") 其中的getchildRows是获得数据包括后台数据吗?还是仅获得加载的数据
--  作者:Bin
--  发布时间:2015/1/27 14:00:00
--  
  只是加载数据

你可以用SQLSelect http://www.foxtable.com/help/topics/2900.htm  获取后台数据

--  作者:Bin
--  发布时间:2015/1/27 14:02:00
--  
例如  

Dim drs As List(of DataRow)  = DataTables("订单").SQLSelect("关联列 = \'" & e.datarow("关联列") & "\'")

For Each 
dr As DataRow In drs
    

Next

--  作者:wh420
--  发布时间:2015/1/27 19:51:00
--  
OK,明白了,多谢Bin老师
--  作者:wh420
--  发布时间:2015/1/29 10:24:00
--  
 

Customer_BeforeDeleteDataRow事件中:

 想实现子表有数据时对应的父表记录不能被删除,GetChildRows换成SQLSelect

If e.DataRow.GetChildRows("Order").Count > 0 Then

    e.Cancel = True

    Messagebox.show("该客户名下有订单信息,不能删除!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)

    Return

End If


--  作者:Bin
--  发布时间:2015/1/29 10:27:00
--  
7楼方法比较好
[此贴子已经被作者于2015-1-29 10:35:35编辑过]

--  作者:有点甜
--  发布时间:2015/1/29 10:34:00
--  
If DataTabes("Order").SqlCompute("count(关联列)", "关联列 = \'" & e.DataRow("关联列") & "\'") > 0 Then
--  作者:wh420
--  发布时间:2015/1/29 14:10:00
--  
问题解决,这个方法好。