以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  学生编号不是空值行数  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=128743)

--  作者:Liangcai
--  发布时间:2018/12/14 0:19:00
--  学生编号不是空值行数


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20181214001954.png
图片点击可在新窗口打开查看

Dim t As Table = e.Form.controls("Table1").Table
If t.Current.DataRow("学生编号") IsNot Nothing Then
    msgbox(t.Rows.Count)
End If

请老师指教,谢谢!

[此贴子已经被作者于2018/12/14 0:21:09编辑过]

--  作者:有点甜
--  发布时间:2018/12/14 9:17:00
--  

Dim t As Table = e.Form.controls("Table1").Table
msgbox( t.Compute("count(学生编号)", "学生编号 is not null") )


 

http://www.foxtable.com/webhelp/scr/0548.htm

 

[此贴子已经被作者于2018/12/14 9:17:12编辑过]

--  作者:Liangcai
--  发布时间:2018/12/14 9:34:00
--  

老师还有个问题,只保存学生编号不是空,请老师指教,谢谢!

Dim ary() As String = Functions.Execute("Xueqi")
Dim t As Table = e.Form.controls("Table1").Table
Dim nms() As String = {"学期","学生编号","缴费日期","缴费金额","收款人"}
For n As Integer = 1 To t.Rows.Count -1
    If t.Rows(n)("学生编号") IsNot Nothing Then
        dr = DataTables("缴餐费").Find("学生编号 = \'" & t.Rows(n)("学生编号") & "\'")
        If dr Is Nothing Then
            dr =  DataTables("缴餐费").AddNew()
        End If
        For Each c As String In nms
            dr(c) = t.Rows(n)(c)
        Next
    End If
    dr.save
Next

[此贴子已经被作者于2018/12/14 9:57:08编辑过]

--  作者:有点甜
--  发布时间:2018/12/14 10:11:00
--  
Dim ary() As String = Functions.Execute("Xueqi")
Dim t As Table = e.Form.controls("Table1").Table
Dim nms() As String = {"学期","学生编号","缴费日期","缴费金额","收款人"}
For n As Integer = 1 To t.Rows.Count -1
    If t.Rows(n)("学生编号") = Nothing Then
        dr = DataTables("缴餐费").Find("学生编号 = \'" & t.Rows(n)("学生编号") & "\'")
        If dr Is Nothing Then
            dr =  DataTables("缴餐费").AddNew()
        End If
        For Each c As String In nms
            dr(c) = t.Rows(n)(c)
        Next
        dr.save
    End If
Next