System.Data.DataColumnCollection.Contains Method

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

Syntax

public bool Contains (string name)

Parameters

name
The DataColumn.ColumnName of the column to look for.

Returns

true if a column exists with this name; otherwise, false.

Remarks

Use the DataColumnCollection.Contains(string) method to confirm the existence of a column before you perform additional operations on the column. The method returns false when two or more columns have the same name but different namespaces. The call does not succeed if there is any ambiguity when matching a column name to exactly one column.

Requirements

Namespace: System.Data
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0