[RESOLVED] remove certain columns from datatable
Hi,
A datatable has several fields, i.e. field1, field2, field3, field9, field10, field88...
string strData = "field1, field2, field3, ...";
Question:
looping through the columns of the datatable, I would like to remove the columns in strData.
So the datatable ends up with the following columns:
field9, field10, field88...
HOw is the above done in C# please?
Thanks
Re: remove certain columns from datatable
Are you referring to a dataTable in C# code or a datatable in a database?
If this is c# code, you can use the remove method:
Code:
dataTable.Columns.Remove("field1");
Re: remove certain columns from datatable