asp.net.ph

DataTableMappingCollection.Remove Method

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
);

Parameters

table
The DataTableMapping to remove.

Implements

IList.Remove

Exceptions


Exception Type Condition
InvalidCastException The object specified is not a DataTableMapping object.
ArgumentException The object specified is not in the collection.

Remarks

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.

Example

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 );
   }
}
  C# VB

See Also

DataTableMappingCollection Members   Add   Clear   Contains Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph