YOUR FEEDBACK
andy.mulholland wrote: intriguing !!! We have full scale 'Mashup Factories' in Chicago USA and Utrec...
AJAXWorld RIA Conference
Early Bird Savings Expire Friday Register Today and SAVE !..


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
POWERBUILDER LINKS YOU MUST CLICK ON


Design and Consume DataWindows in Visual Studio 2005
The power of DataWindow technology

This article talks about the ease with which DataWindows can be designed and consumed in a Microsoft Visual Studio 2005 environment. The DataWindow .NET version 2.5 has the infrastructure to support this concept. With the earlier versions of the DataWindow .NET, such as 1.0, 1.5 and 2.0, the .NET developers had to depend on a standalone DataWindow Designer tool to design DataWindows before consuming it in the .NET Windows Form or ASP.NET applications.

What Is a DataWindow?
For readers who are new to the concept of the DataWindow, let me give a brief introduction on what a DataWindow is all about. The readers familiar with DataWindows may skip this section. The DataWindow is a very popular PowerBuilder technology for building data-driven applications. For any data-driven application, the most common activities the developers perform are:

  • Define the data source.
  • Retrieve the data from the data source.
  • Present the data to the application user.
  • Achieve the CRUD (Create, Retrieve, Update, and Delete) functionality.
The beauty of the DataWindow is that the data-driven applications can be created with very minimal coding. DataWindow consists of two parts.
  • DataWindow Object: The metadata describing the data source and presentation information. This is a logical object residing in a .pbl file.
  • DataWindow Control: The visual container for the DataWindow object; the Datastore is the non-visual container for the DataWindow object.
The DataWindow object can be visually created and modified using the graphical DataWindow painter. The available containers of the DataWindow object for the .NET developers are the Windows Form DataWindow component and the Web DataWindow component.

These are available to the .NET developers through Sybase's DataWindow .NET product.

"Create" in the article title would mean how to create the DataWindow object and "Consume" would mean how the created DataWindow object can be consumed in the .NET Windows Form and ASP.NET Web applications, all from within the Visual Studio IDE.

Design DataWindows in Visual Studio
DataWindow Designer Visual Studio Plug-ins
A few new custom Visual Studio plug-ins have been created to provide this facility to the .NET developers. In Visual Studio terms they are called packages. There are four packages distributed as part of the DataWindow .NET 2.5 as shown in Figure 1.

The packages communicate with the PowerBuilder native functionality through an interop layer called the Plugout. This explains a little bit about the DataWindow Designer plug-in architecture. The following provides a single line description of each of the packages. Details of the packages are shown in the next sections.

  • DataWindow Project: Provides functionality to manage DataWindow projects in the Visual Studio Solution explorer.
  • Database Painter: Provides functionality to create database profiles and connections.
  • DataWindow Painter: Provides functionality to visually design DataWindow objects in the Visual Studio environment.
  • Query Painter: Provides functionality to visually design SQL statements in the Visual Studio environment.
DataWindow Project
A new Visual Studio custom project type with the extension (.dwproj) has been created through this module. This provides the developer with the ability to create DataWindow projects, similar to a C# or a VB project in Visual Studio 2005. The blue rectangular box in Figure 2 shows the DataWindow project hosted in the Visual Studio Solution explorer with a list of DataWindow objects and one of them opened up in the DataWindow painter.

The features provided by this project explorer include the following:

  • New or existing .dwproj (DataWindow project) files can be added into the project using Visual Studio's Add New Project or Add Existing Project wizards.
  • New or existing .pbl (PowerBuilder library) files can be added into the project using the custom Add New Library or Add Existing Library wizards.
  • DataWindow and Query objects can be added into the .pbl files using the custom created Add New Entry wizard.
  • Navigate through the pbls, DataWindow objects and query objects.
  • Copy and move the DataWindow and query objects across pbls.
  • Export DataWindow and query objects as special text files (.srd, .srq).
  • Import .srd and .srq files as objects in the project tree.
  • Build the project to generate .pbd for all the pbls in the project.
Database Painter
This module helps the developer create and maintain database profiles and connections, and database schema maintenance including tables, views, and users. The equivalent for this in the Visual Studio world would be the Server Explorer containing the DB connections. The red rectangular box in Figure 3 shows the database painter hosted in the Visual Studio dockable window.

A database connection needs to be defined before the user can start creating DataWindow and query objects. Two predefined database profiles are distributed as part of the DataWindow .NET 2.5 installation so that the users can get started with designing DataWindows straight away. This module supports the DataWindow and Query painters by managing the database connections required by the painters.

Query Painter
This module helps the developer create and edit Query objects. The Query objects are logical objects and reside inside the .pbl files of the DataWindow project. They help design SQL statements in a Visual Designer and can be a source for DataWindow object creation.

DataWindow Painter
This is the heart of the article where I describe the DataWindow object design. The DataWindow project, Database painter, and Query painter are the support modules for the DataWindow painter.

DataWindow objects are created using an "Add New Entry" wizard, invoked from the .pbl node of a DataWindow project as shown in Figure 4.

The presentation styles supported by the DataWindow object are:

  • Grid, Tabular, Freeform
  • Crosstab, Graph, Group
  • Label, N-Up
  • Composite,Treeview
    NOTE: There is support for a TreeView Web DataWindow in DataWindow .NET 2.5

    The Data Source supported by the DataWindow object are:

  • Database Table using Quick Select, SQL Select, and Query options
  • Stored Procedures
  • Web Services
  • ADO Dataset
    NOTE: Web Services is a new feature of the DataWindow .NET 2.5. (Figure 5)

About Geogy Zachariah
Geogy Zachariah is a senior software engineer with the PowerBuilder? DataWindow team in Sybase Singapore.

YOUR FEEDBACK
Raju wrote: Good Tutorial, helping the .NET developers new to DataWindow.NET. very good.
PBDJ LATEST STORIES . . .
Virtualization is actively being used by Sybase IT to help solve power/cooling issues as well as transform the datacenter into an environment that brings greater benefits to their customers, especially the engineering organization. Average CPU utilization was very low on physical serve...
Must have at least 5 years of recent experience (within the last 7 years) in building, testing, and supporting complex (multiple interfaces with database(s) and other applications) and mission-critical Windows applications using PowerBuilder. Must have at least 5 years of experience wr...
Join Scott Guthrie as he discusses Microsoft’s commitment to web standards development, Rich Internet Applications and how Microsoft is contributing to help move the web forward. Join Adobe’s Kevin Lynch as he demonstrates how Flash and HTML come together to make the most engaging,...
Particularly in a means of moving PowerBuilder applications to the web. What I’m looking for doesn’t require a server license or the installation of unmanaged code to the web server, and works well across different browsers (not just Internet Explorer). The WPF DataWindow will help...
"The rise of Enterprise Architecture is proof that organizations need to manage the impact of changes in competition, technology and regulations across their enterprise," said Dan Lahl, director of Intelligent Enterprise for Sybase. "PowerDesigner 15's unique Link and Synch technology ...
With PowerBuilder 11 Sybase gave developers what we have long hoped for – the possibility of taking an application created in a client/server architecture and turning it into a Web application, almost without having to move the code; and it's better if you don't use a server applicat...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING POWERBUILDER / SYBASE NEWS
Medmatics, LLC, a leading vendor of on-demand, anticoagulation software for private practices and ho...