How to check empty DataTable

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

    First make sure that DataTable is not null and than check for the row count

    if(dt!=null)
    {
      if(dt.Rows.Count>0)
      {
        //do your code 
      }
    }
    

提交回复
热议问题