Clear Method
Collapse the table of content
Expand the table of content

DataColumnCollection.Clear Method ()


Clears the collection of any columns.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

public void Clear()

If the collection is successfully changed by adding or removing columns, the CollectionChanged event occurs.

The following example clears the columns collection.

private void ClearColumnsCollection(DataTable table)
    DataColumnCollection columns;
    // Get the DataColumnCollection from a 
    // DataTable in a DataSet.
    columns = table.Columns;

.NET Framework
Available since 1.1
Return to top
© 2016 Microsoft