How to check empty DataTable

后端 未结 8 582
孤城傲影
孤城傲影 2020-12-10 10:15

I have a DataSet where I need to find out how many rows has been changed using the following code:

dataTable1 = dataSet1.Tables[\"FooTable\"].Ge         


        
8条回答
  •  时光说笑
    2020-12-10 10:54

    Sub Check_DT_ForNull()
    Debug.Print WS_FE.ListObjects.Item(1).DataBodyRange.Item(1).Value
    If Not WS_FE.ListObjects.Item(1).DataBodyRange.Item(1).Value = "" Then
       Debug.Print WS_FE.ListObjects.Item(1).DataBodyRange.Rows.Count
    End If
    End Sub
    

    This checks the first row value in the DataBodyRange for Null and Count the total rows This worked for me as I downloaded my datatable from server It had not data's but table was created with blanks and Rows.Count was not 0 but blank rows.

提交回复
热议问题