Data Controllers / Fields

  Length

Data Controllers / FieldsPrint||
Length

Code On Time web applications automatically limit the amount of text that users are allowed to enter in the text-based input fields. The following screen shot shows the createForm1 form view rendered in the new mode.

Users are not able to enter more than 5 characters in the Customer ID and 30 characters in the Contact Name accordingly.

Automatic enforcement of field length in web apps created with Code On Time

The length of fields is controlled by the Length property of data controller fields. The fields with the type String inherit the limit from the maximum length of the database table column. The limit applies to both single-line and multi-line text boxes.

The list of fields in Customers data controller is shown next. Column Len shows the values assigned by the code generator.

Field property 'Length' can be changed in the list of data controller fields in Project Designer

You can also select any String field in Project Explorer and change the Length property there.

Property 'Length' is available in the data controller fields of the 'String' type

The database exception will be raised if the Length property of a field is left blank and a user enters more data than the database is expecting. The record will remain in the edit or new mode.

An error message is displayed if the Length property of the ContactName is cleared and more than 30 characters are enters when creating a new record.

The error message of database exception raised by Microsoft SQL Server when a text longer than the database column maximum length is entered in the field

Table of Contents