How to check empty DataTable

后端 未结 8 634
孤城傲影
孤城傲影 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:59

    This is an old question, but because this might help a lot of c# coders out there, there is an easy way to solve this right now as follows:

    if ((dataTableName?.Rows?.Count ?? 0) > 0)
    

提交回复
热议问题