asp.net.ph

DataColumnMappingCollection.Contains Method ( Object )

System.Data.Common Namespace   DataColumnMappingCollection Class


Checks whether a given DataColumnMapping object exists in the collection.

[ VB ]
NotOverridable Overloads Public Function Contains ( _
   ByVal columnMapping As Object _
) As Boolean Implements IList.Contains

[ C# ]
public bool Contains (
   object columnMapping
);

[ C++ ]
public: __sealed bool Contains (
   Object* columnMapping
);

[ JScript ]
public function Contains (
   columnMapping : Object
) : Boolean

Parameters

columnMapping
A DataColumnMapping object to find.

Return Value

This method returns only a boolean value: true if the collection contains a specified DataColumnMapping object; otherwise, false.

Implements

IList.Contains

Exceptions


Exception Type Condition
InvalidCastException The parameter passed is not a DataColumnMapping object.

Remarks

Use the Contains method to confirm the existence of a column mapping object before performing further operations on the object.

Example

The following example first uses the Contains method to determine if a particular column mapping exists in the collection. If found, the column mapping is removed with the Remove method.

private void RemoveColumnMapping ( DataTableMapping myTableMap, object myFieldMap ) {
   // get the DataColumnMappingCollection of a DataTableMapping
   DataColumnMappingCollection myFieldsMaps = myTableMap.ColumnMappings;
   if ( myFieldsMaps.Contains ( myFieldMap ) {
      myFieldsMaps.Remove ( myFieldMap );
   }
}
  C# VB

See Also

DataColumnMappingCollection Members   DataColumnMappingCollection.Contains Overload List 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