ObjectSharp Blogs

You are currently viewing

Dave Lloyd's 2 Cents

A .NET Developer's Perspective


What is a DataWindow?

Since I started Blogging about the .NET DataWindow. I have had some developers ask the following questions:

  • What is so great about a DataWindow?
  • Why do you care if you can use one in your .NET application?
  • Why not just use a DataGrid?

I thought I would try and answer some of these questions for those that have never used Powerbuilder.

First you must realize there are two different objects that both get called a DataWindow. A PowerBuilder developer knows which you are talking about by the context it's used in. They are

  • DataWindow Object - Class which contains the Presentation and SQL to retrieve Data and display it to the user.
  • DataWindow Control - A Control you place on your window that takes a DataWindow Object as one of it's parameters. This object presents the DataWindow Object to the user on your form.
    • Inheritable
    • Sample Methods
      • Retrieve
      • Update
    • Sample Events
      • RowFocusChanged
      • ItemChanged

In the DataWindow editor you define a DataSource, the problem is that DataSource is part of the Datawindow Object. Sybase has to change the .NET Datawindow to take an external DataSource, like a DataSet or Business Object that implements IListSource. I may write something that hooks a DataSet to a DataWindow if I get time. Perhaps Sybase will fly me down to meet with the.NET DataWindow Architects and give them some suggestions. Hint Hint

Back to how it works. Once you have your Data Source defined you move to the presentation side of the DataWindow. Here is the good thing about having the data and presentation together in one object. There is no binding issues. You get a column for each column in the result set. So you paint your Datawindow and please realize this is not just a grid. This can be a graph, labels, grid, tabular or you can make it look just like a for with buttons, group boxes, textboxes and labels.

Once you have a completed DataWindow. You drop a DataWindow Control on your form set the DataObject Property to the name of your DataWindow Object. Then just tell the DataWindow Control what Transaction you are using and call the retrieve method.

So that is a really simple example of how it works. In my next Blog entry I'll tell you why I think they are so good. 

Comments

  • dave August 12, 2004 11:27 AM

    Sure, come on down to Auburn AL and we can discuss DataSet implementation sometime <g>.
    I am right now working on the spec for DataSet support in DataWindow .NET. If you'd like to talk send me a number where I could reach you. I'd like to hear some real life experience with DataSets and how we might best use them in the DataWindow.

  • dave August 12, 2004 3:09 PM

    Dave.

    A real life example would be to have a DataSet Wrapped by an Entity Object, with the Entity Object Wrapped by a Business Object , with the Business Object dropped on the Designer of a Window. If the DataWindow could pick up the underlying DataSet and bind to it (like a DataGrid) then this would be fantastic.

  • dave August 12, 2004 3:50 PM

    Matt... That would be very cool. But lets not forget we are dealing with something very different from a datagrid. You would have to specify the DatawSet in the DataWindow editor. So you could then draw your datawindow presentation side.

    Unless the Datawindow designer could read the XSD to get the schema. Then at design time on the form. The DataWindow Control has one property for DataObject and one for DataSource.

  • dave March 24, 2006 3:01 AM

    i love your site man.

  • dave March 28, 2006 2:11 AM

    Datawindow is a sql representation in different style sheet.

Leave a Comment

(required) 
(optional)
(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS