Foxtable(狐表)用户栏目专家坐堂 → 下面的代码怎么会增加两行,我想只增加一行


  共有2593人关注过本帖树形打印复制链接

主题:下面的代码怎么会增加两行,我想只增加一行

帅哥哟,离线,有人找我吗?
jinzhengbe
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1062 积分:9781 威望:0 精华:0 注册:2012/3/13 5:23:00
下面的代码怎么会增加两行,我想只增加一行  发帖心情 Post By: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编辑过]

 回到顶部