How can I delete a column of a Dataset?
Is there a method that will do this for me like this:
rh.dsDetail = ds.Tables[0].Columns.Remove(
Or maybe like this:
rh.dsDetail = ds.Tables[0].Columns.Remove( ds.Tables[0].Columns[1],ds.Tables[0].Columns[2])
First, a
DataTablehas columns, not a data-set.If you want to get rid of them, then:
otherwise, if you have the index:
should do the job if you have the column index. Note that if you remove column 0, then the numbers will shuffle (so you might need to do in reverse order).
Alternatively, you may want to remove by name: