This topic has not yet been rated - Rate this topic

IColumnMappingCollection.RemoveAt Method

Removes the IColumnMapping object with the specified SourceColumn name from the collection.

[Visual Basic]
Sub RemoveAt( _
   ByVal sourceColumnName As String _
)
[C#]
void RemoveAt(
   string sourceColumnName
);
[C++]
void RemoveAt(
   String* sourceColumnName
);
[JScript]
function RemoveAt(
   sourceColumnName : String
);

Parameters

sourceColumnName
The case-sensitive SourceColumn name.

Exceptions

Exception Type Condition
IndexOutOfRangeException A DataColumnMapping object does not exist with the specified SourceColumn name.

Example

[Visual Basic, C#, C++] The following example searches for an instance of the derived class, DataColumnMapping, with the given SourceColumn name within a DataColumnMappingCollection collection. If the DataColumnMapping exists, the mapping is removed. This example assumes that a DataColumnMappingCollection collection has been created.

[Visual Basic] 
Public Sub RemoveDataColumnMapping()
    ' ...
    ' create myColumnMappings
    ' ...
    If myColumnMappings.Contains("Picture") Then
        myColumnMappings.RemoveAt("Picture")
    End If
End Sub

[C#] 

 public void RemoveDataColumnMapping() {
    // ...
    // create myColumnMappings
    // ...
    if (myColumnMappings.Contains("Picture"))
        myColumnMappings.RemoveAt("Picture");
 }

[C++] 
void RemoveDataColumnMapping() {
   // ...
   // create myColumnMappings
   // ...
   if (myColumnMappings->Contains("Picture"))
       myColumnMappings->RemoveAt("Picture");
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

IColumnMappingCollection Interface | IColumnMappingCollection Members | System.Data Namespace

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.