Data Control

The Data control allows you to bind data from an external data source to existing controls on your form.

Client support

   Newlook Smartclient

   Newlook Server

Use

Once a connection to the external data source is established, via the ConnectionString property of the data control, then any other control bound to the data control will automatically display the specified field for the current record.

To bind an existing control to a data control, you need to set the DataSource property to the name of the Data control and the DataField property to a specific field in the data source.

The Data control performs operations on the current record and updates all controls bound to it. It provides navigation buttons to allow the user to move to the first, last, next, or previous record in the data source.

For example, if the user clicks the 'next record' button, all bound controls automatically save any changes to the data back to the database, the Data control moves to the next record and data from the current record is passed to any bound controls.

The Data control automatically handles a number of contingencies including emptying recordsets, adding new records, editing and updating existing records, and handling some types of errors. It provides automated navigation of records and support for browsing, updating and record creation without the need to write any code.

Alert!

In more sophisticated applications, you may need to trap some error conditions that the Data control cannot handle. For example, if the Microsoft Jet database engine has a problem accessing the database file, doesn't have permission, or can't execute the query as coded, a trappable error results. If the error occurs before your application procedures start or due to some internal errors, the Error event is triggered.

Material skin considerations

When the material skin is enabled in your solution, data controls will be rendered in your specified material primary color.

Material skin

Classic skin

Methods

None.

See Also

DataGrid control


© 2004-2021 looksoftware. All rights reserved.