以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  取关联子表行的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=100617)

--  作者:xvkewen
--  发布时间:2017/5/15 12:19:00
--  取关联子表行的问题

请看以下代码,明明R1和currenttable.current是同一行,为什么R1取得的关联子表的行数为0呢?

 

Dim InputSRS As String = "BR1610-03347"

If Inputsrs <> "" Then

    Dim r1 As DataRow = DataTables("MainSchedule").SQLFind("SrsNO = \'" & Inputsrs & "\'") \'   

If r1 IsNot Nothing Then

        Output.Show("identify =" & r1("_identify"))

        If r1.GetChildRows("ProcessSchdule") IsNot Nothing Then

           Output.Show(r1.GetChildRows("ProcessSchdule").Count)            

        End If

End If

End If

 

Output.Show("identify =" & CurrentTable.Current("_identify"))

Output.Show(CurrentTable.Current.DataRow.GetChildRows("ProcessSchdule").Count)


此主题相关图片如下:微信截图_20170515100924.png
按此在新窗口浏览图片

--  作者:有点色
--  发布时间:2017/5/15 12:24:00
--  

sqlFind的行,不能直接用GetChildRows

 

你还是乖乖用select查询子表行 http://www.foxtable.com/webhelp/scr/0400.htm