Try OpenEdge Now
skip to main content
Introducing the Progress Developer Studio for OpenEdge Visual Designer
Creating the Customer Window : Data binding : Attaching the ProBindingSource control to a data source : Updating the existing constructor and destructor
 
Updating the existing constructor and destructor
To update the existing constructor and destructor:
1. Find the CONSTRUCTOR declaration in the file.
2. Add the code shown in bold:
CONSTRUCTOR PUBLIC customerForm ( ):

SUPER().
oServiceAdapter = NEW

openedge.tutorial.services.ServiceAdapter("CustMaint").
InitializeComponent ( ).
OpenQuery().
CATCH e AS Progress.Lang.Error:
UNDO, THROW e.
END CATCH.
END CONSTRUCTOR.
This step implements data access by creating a service adapter that uses a ProDataSet (CustMaint) that is defined in BECustMaint.cls.
3. Find the DESTRUCTOR declaration in the file.
4. Add the code shown in bold:
DESTRUCTOR PUBLIC customerForm ( ):

closeQuery().

IF VALID-OBJECT(components) THEN DO:
CAST(components, System.IDisposable):Dispose().
END.

END DESTRUCTOR.
5. Press CTRL+S to save your changes.