03-09-19 12:29 PM
03-09-19 03:26 PM
Here's a C# stage I wrote.
Edit: I apologize ahead of time for the inefficiency of this one, especially if there's a ton of columns. I'm keen to see if anyone has a better solution!
Inputs:
Collection - Collection
Outputs:
New Collection - Collection
DataView dv = Collection.DefaultView; //Label to prevent 'Collection was modified' errors Out: foreach(DataColumn col in Collection.Columns) { if(col.DataType == System.Type.GetType("System.String")) dv.RowFilter = col.Caption+" =''"; else dv.RowFilter = col.Caption.ToString() + " = null"; if(dv.Count == Collection.Rows.Count) { Collection.Columns.Remove(col); goto Out; } } New_Collection = Collection;