NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ColumnsCollection.Contains

Checks whether the collection contains a specified column.

Overload List

Checks whether the collection contains a column with the specified name.

[Visual Basic] Overloads Public Function Contains(String) As Boolean
[C#] public bool Contains(String);
[C++] public: bool Contains(String*);
[JScript] public function Contains(String) : Boolean;

Checks whether the collection has a column at the specified index.

[Visual Basic] Overloads Public Function Contains(Integer) As Boolean
[C#] public bool Contains(int);
[C++] public: bool Contains(int);
[JScript] public function Contains(int) : Boolean;

Example [Visual Basic]

The following example uses the Contains method and the CanRemove method to determine whether the column can be removed. If so, the column is removed.

Note   This example shows how to use one of the overloaded versions of Contains. For other examples that may be available, see the individual overload topics.

[Visual Basic]

Dim cols As ColumnsCollection
' Get the ColumnsCollection from a DataTable in a DataSet.
cols = DataSet1.Tables("Orders").Columns
If cols.Contains(2) And cols.CanRemove(cols(2)) Then
   cols.Remove 2
End If

See Also

ColumnsCollection Class | ColumnsCollection Members | System.Data Namespace