System.Data.UniqueConstraint Class

Represents a restriction on a set of columns in which all values must be unique.

See Also: UniqueConstraint Members

Syntax

[System.ComponentModel.DefaultProperty("ConstraintName")]
[System.ComponentModel.Editor("Microsoft.VSDesigner.Data.Design.UniqueConstraintEditor, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public class UniqueConstraint : Constraint

Remarks

The System.Data.UniqueConstraint is enforced on a single column (or columns) to ensure that a primary key value is unique.

Constraints are not enforced unless the DataSet.EnforceConstraints property is set to true.

When the a System.Data.DataSet is merged with a second System.Data.DataSet, constraints are not enforced until all merges are completed.

Requirements

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