21.8 Data-binding in Tradepoint
Sep/26/2008
Tradepoint
uses a unique default method for data-binding to work around significant issues
with the default mechanism within .NET. On all frmBaseForm derrived forms there
is a component called "dataBinding" which is an extenderprovider that allows you
to do all saving and loading. This control has two properties that will need to
be updated. Ensure that you have set your Connection's (con) connection string
to your local database before updating these properties otherwise Visual Studio
will crash.
Table: This defines the table in the
database that will be used to persist the data and load it into the
controls.
TimeStampField: This should always be
set to the Modified field within the table selected.
All other
properties should be left to the defaults.
On any
control that is now put on the form you will be provided with additional
properties for that control. Namely:
ControlProperty: This allows you to
control which property holds the value that will be persisted to the
database.
DataField: this allows you to select
the field within the database that the data will be persisted to.
Once you
have set these values on each control, simply setting the dataBinding.ID
property will result in the values displayed in the controls. Calling the
.Update() method or using the UpdateRecord() method on the derived forms will
update the data source with the values in the controls.