以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  下面的代码怎么会增加两行,我想只增加一行  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=67771)

--  作者:jinzhengbe
--  发布时间:2015/5/1 19:56:00
--  下面的代码怎么会增加两行,我想只增加一行

If e.DataRow.isnull("cord")=False Then
       Dim dr As DataRow
        dr = DataTables("product").Find("[cord] = \'" & e.NewValue & "\'")
        If dr IsNot Nothing Then \'如果找到了同名的产品行,也就是dr不是Nothing
            e.DataRow("name") = dr("shangpinming")
            e.DataRow("markprice") = dr("markprice")
           
Else

e.DataRow("nnn")=e.DataRow("name")     

If e.DataRow.isnull("nnn")=False And dr Is Nothing Then
Dim idxs As String = ""
For i As Integer = Tables("rukudanhao.rukudan").TopPosition To Tables("rukudanhao.rukudan").BottomPosition
    idxs &= Tables("rukudanhao.rukudan").Rows(i)("_Identify")
Next

Dim f As New Filler
f.Filter = "_Identify in (" & idxs.Trim(",") & ")"
f.SourceTable = DataTables("rukudan") \'指定数据来源
f.SourceCols = "cord,name,markprice" \'指定数据来源列
f.DataTable = DataTables("product") \'指定数据接收表
f.DataCols = "cord,shangpinming,markprice" \'指定数据接收列
f.Fill() \'填充数据
DataTables("product").save()
End If
End If


end If

 

执行结果 product 表会新增加 两行内容

请教~~~~

[此贴子已经被作者于2015/5/5 12:23:18编辑过]