Hyderabad Jobs Book Website FREE PowerBuilder Training I Love Hyderabad Hyderabad Colleges
Home Business Emails Hyderabad Classifieds Contact Us
7 Wonders of Hyderabad Web Hosting Yellow Pages Our Network

 
Webpowerbuilder.hyderabad-colleges.com

Introduction to PowerBuilder

HomePrevious Lesson: DataWindow Painter
Next Lesson: Creating a DataWindow

Introduction

A DataWindow is a data aware object and is used to retrieve, manipulate and display data from a database. DataWindow reduces to a minimum the need for the code ( which has been specially developed to get the data from a database into a presentable format on screen ) by internally creating native database related commands.

There are two main parts to a DataWindow - retrieval of data from the database and display of that retrieved data. Let us start with how to connect to a database and retrieve the data and then we can learn how to present the data in different styles.

Objects and Controls, Data and Users

There are 4 main steps in creating a DataWindow and using it in your application:
1. Select a data source and a presentation style. In other words the way data is to be extracted from a database and the format in which the data should be displayed.
2. Define appropriate SQL statements which would provide information to the user; this is referred to as the 'Data Source' definition. In data source you define the data to be brought from the database, for example a SELECT statement to retrieve all product information.
3. Paint the DataWindow (define fonts, colors, location for each field, etc.) to appropriately display the information.
4. Associate the DataWindow object with a DataWindow control (you have learned about this control in the window painter) on a window, so that the data held in the object can be displayed to the user.
5. Write PowerScript statements, functions to act on the DataWindow control.

The following diagram illustrates how PowerBuilder uses a data source, DataWindow objects, DataWindow controls and the user interface:

A DataWindow object definition consists of any display information, initial values, validation rules and SQL statement definitions required to present the user with the appropriate data, ready for alteration or review. Once a DataWindow object has been defined it has to be associated with a DataWindow control placed on a Window.

In simple terms a DataWindow object is for data retrieval. It contains information necessary to retrieve the data to be seen on the window, the formatting that is needed to apply on the information and the manner in which it has to be passed to the DataWindow control. Remember that the difference between a DataWindow object and a DataWindow control (you learned in the Window Painter session) is that the control simply displays the information, while the object gets the appropriate information and formats it as required. DataWindow control is a container for the DataWindow object.

DataWindow objects are independent of DataWindow controls and so can be associated with any number of controls. A very powerful feature being that these associations can be changed dynamically at run-time.
HomePrevious Lesson: DataWindow Painter
Next Lesson: Creating a DataWindow

Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com