DataColumnMappingCollection.RemoveAt Method (Int32)

 

Removes the DataColumnMapping object with the specified index from the collection.

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

public void RemoveAt(
	int index
)

Parameters

index
Type: System.Int32

The zero-based index of the DataColumnMapping object to remove.

Exception Condition
IndexOutOfRangeException

There is no DataColumnMapping object with the specified index.

The following example searches for a DataColumnMapping object with the given index within a DataColumnMappingCollection collection. If the DataColumnMapping exists, the mapping is removed. This example assumes that a DataColumnMappingCollection collection has been created.


public void RemoveDataColumnMapping() 
{
    // ...
    // create mappings
    // ...
    if (mappings.Contains(7))
        mappings.RemoveAt(7);
}

.NET Framework
Available since 1.1
Return to top
Show: