以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  新增行为空问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=89963)

--  作者:良才
--  发布时间:2016/9/2 9:15:00
--  新增行为空问题

If Tables("缴证信息").新增行为空 Is Nothing Then

请指点,谢谢!

[此贴子已经被作者于2016/9/2 9:21:57编辑过]

--  作者:有点蓝
--  发布时间:2016/9/2 10:03:00
--  
Dim cls() As String = {"第一列","第二列"}
For Each r As DataRow In DataTables("表A").DataRows
    If r.RowState = DataRowState.Added Then
        For Each c As String In cls
            If r.IsNull(c) Then
                msgbox(c & "列不能为空!")
                Return
            End If
        Next
    End If
Next

--  作者:良才
--  发布时间:2016/9/2 14:50:00
--  

这样行不?

Tables("缴证信息").StateFilter = StateFilterEnum.Added
If Tables("缴证信息").Current Is Nothing Then

[此贴子已经被作者于2016/9/2 14:50:59编辑过]

--  作者:有点蓝
--  发布时间:2016/9/2 15:33:00
--  
判断Current没有用的,必须判断具体的列值
Tables("缴证信息").StateFilter = StateFilterEnum.Added
Dim cls() As String = {"第一列","第二列"}
For Each r As Row In Tables("缴证信息").Rows
        For Each c As String In cls
            If r.IsNull(c) Then
                msgbox(c & "列不能为空!")
                Return
            End If
        Next
Next