asp.net.ph

Constraint.ConstraintName Property

System.Data Namespace   Constraint Class


Sets or retrieves the name of a constraint.

Syntax


Script Constraint.ConstraintName [ = strName ]

Property Value


strName The name of the Constraint.

The property is read/write with no default value.

Exceptions


Exception Type Condition
ArgumentException Occurs when the value is a null or empty string.
DuplicateNameException Occurs when the ConstraintCollection already contains a Constraint of the same name. The comparison is not case-sensitive.

Remarks

The ConstraintCollection is returned by the Constraints property of the DataTable class.

Example

The following example iterates through the ConstraintCollection of a DataTable and prints each ConstraintName.

private void getConstraintNames ( DataTable myTable ) {

   foreach ( Constraint cs in myTable.Constraints ) {
      Response.Write ( cs.ConstraintName );
   }
}
  C# VB

See Also

Constraint Members 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