Clear Method

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
© 2015 Microsoft