Export (0) Print
Expand All

DataTableMappingCollection.RemoveAt Method

Removes the specified DataTableMapping object from the collection.

Overload List

Removes the DataTableMapping object located at the specified index from the collection.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Sub RemoveAt(Integer) Implements IList.RemoveAt
[C#] public virtual void RemoveAt(int);
[C++] public: virtual void RemoveAt(int);
[JScript] public function RemoveAt(int);

Removes the DataTableMapping object with the specified source table name from the collection.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Overridable Sub RemoveAt(String) Implements ITableMappingCollection.RemoveAt
[C#] public virtual void RemoveAt(string);
[C++] public: virtual void RemoveAt(String*);
[JScript] public function RemoveAt(String);

Example

[Visual Basic, C#, C++] The following example searches for a DataTableMapping object with the given source table name within a DataTableMappingCollection collection. If the DataTableMapping exists, the mapping is removed. This example assumes that a DataTableMappingCollection collection has been created.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of RemoveAt. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub RemoveDataTableMapping()
    ' ...
    ' create myTableMappings
    ' ...
    If myTableMappings.Contains("Categories") Then
        myTableMappings.RemoveAt("Categories")
    End If
End Sub

[C#] 
public void RemoveDataTableMapping() {
   // ...
   // create myTableMappings
   // ...
   if (myTableMappings.Contains("Categories"))
       myTableMappings.RemoveAt("Categories");
}

[C++] 
void RemoveDataTableMapping() {
   // ...
   // create myTableMappings
   // ...
   if (myTableMappings->Contains(S"Categories"))
       myTableMappings->RemoveAt(S"Categories");
}

[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.

See Also

DataTableMappingCollection Class | DataTableMappingCollection Members | System.Data.Common Namespace

Show:
© 2014 Microsoft