Stefano Brunato
Stefano Brunato

Reputation: 29

Delete Columns from datatable

I need to delete a lot of columns from my data table. Does exist any query in C# with LINQ or any command that do this in a simple way by specifying the name of the column? Something like: dt.DeleteColumn("column name"); Or maybe clone only the column that i need in another dt?

Upvotes: 0

Views: 1368

Answers (1)

Donald
Donald

Reputation: 399

dt.Columns.Remove("IHateThisColumn");

Upvotes: 1

Related Questions