以文本方式查看主题

-  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=8804)

--  作者:gaoqr
--  发布时间:2010/12/9 10:46:00
--  [求助]怎样定义当前行?
http://help.foxtable.com/topics/0431.htm  中的代码

Dim drs As List(Of Datarow)
drs = 
DataTables("产品").DataRows(0).GetChildRows("订单")
For Each 
dr As DataRow In drs
    dr(
"折扣") = 0.1

Next

想改 DataRows(0为当前行,怎样定义?

--  作者:gaoqr
--  发布时间:2010/12/9 10:53:00
--  
If e.DataCol.name = "商砼" Then
    If e.DataRow("商砼") = True Then
        Dim prs As List(Of DataRow)
        prs = DataTables("实体预算书").e.DataRow.GetChildRows("实体材料分析")
        For Each pr As DataRow In prs           
            If pr("材料编号") = "AZ0020" Then
                pr("系数") = 0.2
            Else If pr("材料编号") = "XD0300" Or pr("材料编号") = "XF0030" Then
                pr("定额用量") = 0
            End If
        Next
    End If
End If

想改为这样,出现错误。
[此贴子已经被作者于2010-12-9 10:57:56编辑过]

--  作者:czy
--  发布时间:2010/12/9 10:54:00
--  
Dim drs As List(Of DataRow)
drs = Tables("产品").Current.DataRow.GetChildRows("订单")
For Each dr As DataRow In drs
    dr("折扣") = 0.1
Next

--  作者:gaoqr
--  发布时间:2010/12/9 10:57:00
--  
谢谢 czy 版主!