Foxtable(狐表)用户栏目专家坐堂 → [求助]数据引用


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

主题:[求助]数据引用

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110571 积分:562745 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/3/14 16:29:00 [显示全部帖子]

If e.DataCol.Name = "材料代号" Then
    Dim nms() As String = {"外形尺寸_本体直径","外形尺寸_本体高","电容量测试值","损耗角正切测试值","漏电流测试值","材料代号"}
   
    Dim drs As List(of DataRow) = DataTables("电解电容检验记录数据库").Select("材料代号 = '" & e.NewValue & "'")
    systemready = False
    If drs.count <= 10 Then
        For Each dr As DataRow In drs
            Dim dr2 As DataRow = e.DataTable.Addnew
            For Each nm As String In nms
                dr2(nm) =dr(nm)
            Next
        Next
       
    Else
        Dim i As Integer = 1
        Do
            Dim Id As Integer = rand.Next(0,drs.count)
            Dim dr5 As DataRow = drs(id)
            Dim dr3 As DataRow = e.DataTable.Addnew
            For Each nm As String In nms
                dr3(nm) =dr5(nm)
            Next
            i += 1
        Loop While i <= 10
    End If
    e.DataRow.Delete
    systemready = True
End  If


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110571 积分:562745 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/3/15 15:06:00 [显示全部帖子]

11楼的代码操作的只有一行,还是参考9楼的代码吧

 回到顶部