Just move the NOT (
!
) out one level. You want the items where "all rows are null" is not true, rather than where "all of the rows are not null" is true.DataTable filteredRows = dt.Rows.Cast<DataRow>()
.Where(row => !row.ItemArray.All(field => field is System.DBNull))
.CopyToDataTable();
No comments:
Post a Comment