Working with validation rules
256 DataWindow .NET
At runtime
In code, you can use the GetColumnValidation method to obtain the validation
rule for a column and the
SetColumnValidation method to change the validation
rule for a column.
For information about the
GetColumnValidation and SetColumnValidation
methods, see the online help.
Working with validation rules
You work with validation rules in the Database painter and DataWindow object
painter.
What you do in the
Database painter
In the Database painter, you can:
• Create, modify, and delete named validation rules
The validation rules are stored in the extended attribute system tables.
Once you define a validation rule, it can be used by any column of the
appropriate datatype in the database.
• Assign validation rules to columns and remove them from columns
These rules are used by default when you place the column in a
DataWindow object in the DataWindow object painter.
What you do in the
DataWindow painter
In the DataWindow painter, you can:
• Accept the default validation rule assigned to a column in the Database
painter
• Create an ad hoc, unnamed rule to use with one specific column
Validation rules and
the extended attribute
system tables
Once you have placed a column that has a validation rule from the extended
attribute system tables in a DataWindow object, there is no longer any link to
the named rule in the extended attribute system tables.
If the definition of the validation rule later changes in the extended attribute
system tables, the rule for the column in a DataWindow object will not change.