Sure, here it is:
'here we delete any empty columns from the datatable
For i As Integer = ds.Tables(0).Columns.Count - 1 To 0 Step -1
If ds.Tables(0).Columns(i).DataType Is GetType(String) Then
'Replacement made here
'ds.Tables(0).DefaultView.RowFilter = ds.Tables(0).Columns(i).Caption & "=''"
Dim colName As String = ds.Tables(0).Columns(i).ColumnName
ds.Tables(0).DefaultView.RowFilter = colName & " = '' or " & colName & " is null"
If ds.Tables(0).DefaultView.Count = ds.Tables(0).Rows.Count Then _
ds.Tables(0).Columns.RemoveAt(i)
End If
Next