System.Data.Common Namespace DataTableMappingCollection Class
Removes the specified DataTableMapping from the collection.
[ VB ]
NotOverridable Public Sub Remove ( _
ByVal table As Object _
) Implements IList.Remove
[ C# ]
public void Remove (
Object table
);
[ C++ ]
public: __sealed void Remove (
Object* table
);
[ JScript ]
public function Remove (
table : Object
);
- table
- The DataTableMapping to remove.
IList.Remove
Use this method to remove a given DataTableMapping object from the TableMappings collection of a specified DataTableMapping object.
To remove a DataTableMapping at a specified index in the collection, use the RemoveAt method. To remove all members of the collection at once, use the Clear method.
This method also resets the TableMappings.Count property.
The following example first uses the Contains method to determine if a particular table mapping exists in the collection. If found, the table mapping is removed with the Remove method.
private void RemoveTableMapping ( DataAdapter myAdapter, object myTable ) {
// get the table mappings collection
DataTableMappingCollection myTables = myAdapter.TableMappings;
if ( myTables.Contains ( myTable ) {
myTables.Remove ( myTable );
}
}
Private Sub RemoveTableMapping ( myAdapter As DataAdapter, myTable As Object )
' get the table mappings collection
Dim myTables As DataTableMappingCollection = myAdapter.TableMappings
If myTables.Contains ( myTable ) Then
myTables.Remove ( myTable )
End If
End Sub |
|
C# |
VB |
DataTableMappingCollection Members Add Clear Contains