Clear Method

DataColumnMappingCollection.Clear Method ()

 

Removes all DataColumnMapping objects from the collection.

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

public void Clear()

Implements

IList.Clear()

The following example exports the collection to an array of DataColumnMapping objects. It then clears the collection, and returns true if the parameters are no longer persisting. This example assumes that a DataColumnMappingCollection collection has been created.

public bool PushIntoArray() 
{
    // ...
    // create mappings
    // ...
    DataColumnMapping[] columns = new DataColumnMapping[0];
    mappings.CopyTo(columns, 0);
    mappings.Clear();
    return true;
}

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