How to check DBNull value in Linq query results

前端 未结 4 1334
耶瑟儿~
耶瑟儿~ 2020-12-10 08:59

I am using the below code and trying to group by Currency and Code. After this I am trying to loop through the result set.

But the issue is while looping through the

4条回答
  •  爱一瞬间的悲伤
    2020-12-10 09:58

    The way to find the number of CELLS with DBNulls for a specific column:

    int numOfEmptyColA = MyDataTable.AsEnumerable().Where(p=>p.IsNull("ColA")).Count();
    

提交回复
热议问题