编辑
这将删除每个列包含任何内容或空格的所有行:
dataTable = dataTable.Rows.Cast(). Where(row => !row.ItemArray.All(field => field is System.DBNull || string.Compare((field as string).Trim(), string.Empty) == 0)).CopyToDataTable();
预
获得成功的一种方法是检查空值
DataView dv = null; dv = new DataView(); { dv.Table = myDatatable; dv.AllowDelete = true; dv.AllowEdit = true; dv.AllowNew = true; dv.RowFilter = "myField = ' '"; }