System.Data.Common Namespace DataTableMappingCollection Class
Removes a specified DataTableMapping from the collection.
1. Removes the DataTableMapping at the specified index.
2. Removes the DataTableMapping with the specified SourceTable name.
The following example first uses the Contains method to find a DataTableMapping with the specified source table name within the TableMappings collection of a specifed DataTableMapping object. If the mapping exists, the example removes it.
NOTE: This example uses one of the overloaded versions of RemoveAt. For other examples that may be available, see the individual overload topics.
public void SearchTableMappings ( DataAdapter myAdapter ) {
DataTableMappingCollection myTables = myAdapter.TableMappings;
if ( myTables.Contains ( "tmpOrders" )
myTables.RemoveAt ( "tmpOrders" );
}
Public Sub SearchTableMappings ( ByVal myAdapter As DataAdapter )
Dim myTables As DataTableMappingCollection = myAdapter.TableMappings
If myTables.Contains ( "tmpOrders" ) Then
myTables.RemoveAt ( "tmpOrders" );
End If
End Sub |
|
C# |
VB |
DataTableMappingCollection Members