PowerBuilder to ASP.NET migration: EASY!!

The collaboration of PowerBuilder turns the whole process of Microsoft .NET Application Development swift, smooth and pocket friendly. PowerBuilder has earned fame for offering an environment for a fast, and cost-effective application development – much useful in case of the creation of business applications that are meant for delivering data-oriented solutions! PowerBuilder is an authority tool that offers complete support for Win32 and .NET Framework development – with equal ease of integration.The whole process of migration is being discussed in this article using SQLWays. SQLWays is a exciting tool that can make the migration of PowerBuilder to ASP.NET much easier with egard to many aspects! On a step by step way, the whole migration process is elaborated here.

11977161-aspnet-app-development

The primary Conversion Features

SQLWays application migration tool paves the path of migration from PowerBuilder to ASP.NET. But, there are certain factors which must be known to the developer while performing the task. Most of the asp.net developers prefer it because of the ease of operation it renders. Let dig a little deep.

1. Primarily Application source files (.SRA files) is Converted

All the basic information needed for the initiation of the process lies in a SRA source file with a starting entry point:

forward
globalTYPEsimple_demoFROM application
ENDTYPE
END forward
globalTYPEsimple_demoFROM application
stringappname=”simple_demo”
ENDTYPE
globalsimple_demosimple_demo
ONsimple_demo.CREATE
ENDON
eventOPEN;
OPEN(simple_demo_main)
END event
After that the SRA file is turned into Class using the Transfer Method that is summoned to initiate the application igniting the migration wheel:

public partial class _simple_demo:System.Web.UI.Page
{
protectedvoidPage_Load(object sender, EventArgs e)
{
Server.Transfer(“simple_demo_main.aspx”);
}
}

2. In this phase the emphasis is laid over conversion of Window objects (.SRW files) to ASPX
SRW file has in it complete description about component items and form along with events and processes as this is a windows source file. Due to this the conversion of SRW file to ASPX becomes quite easy task.For performing the job you might think about using simple form with a control element for executing the steps as follows:

$PBExportHeader$simple_demo_main.srw
forward
globalTYPEsimple_demo_mainFROM window
ENDTYPE
TYPEb_buttonFROMcommandbuttonWITHINsimple_demo_main
ENDTYPE
END forward
globalTYPEsimple_demo_mainFROM window
INTEGER width =800
INTEGER height =1200
BOOLEANtitlebar=TRUE
string title =”simple_demo”
b_buttonb_button
ENDTYPE
globalsimple_demo_mainsimple_demo_main
ONsimple_demo_main.CREATE
this.b_button=CREATEb_button
this.Control[]={this.b_button}
ENDON
ONsimple_demo_main.destroy
destroy(this.b_button)
ENDON
TYPEb_buttonFROMcommandbuttonWITHINsimple_demo_main
INTEGER x =400
INTEGER y =400
INTEGER width =200
INTEGER height =120
string text =”Show”
ENDTYPE
event clicked;
END event

Upon the completion of the previous steps the declare control is transformed to class designer with the usage of following codes as example:

public partial class _simple_demo_main{
protectedSystem.Web.UI.HtmlControls.HtmlFormsimple_demo_main;
protectedSystem.Web.UI.WebControls.Buttonb_button;
}In this stage you get the description of form and component transformedinto an ASPX file in detail:<%@ Page LANGUAGE=”C#”AutoEventWireup=”true”
CodeBehind=”simple_demo_main.aspx.cs”
Inherits=”simple_demo._simple_demo_main”%><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”><html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head id=”Head1″runat=”server”>
<title>simple_demo</title>
</head>
<body>
<form id=”simple_demo_main”runat=”server”>





Width=”44″ Height=”30″onclick=”b_button_Click”>

 

 

 

 

</form>
</body>
</html>

Now the need of turning event into class method comes ahead and this gets done via following way:

public partial class _simple_demo_main:System.Web.UI.Page

{
protectedvoidPage_Load(object sender, EventArgs e)
{
}
protectedvoidb_button_Click(object sender, EventArgs e)
{
}
}
Just like the case of PowerBuilder application the SQLWayskeeps the record of size and location property of components for smooth operation:
asp .net developers
3. Now go for the conversion of  menu (.srm) to standard user control
As from the very beginning it is being stated that SRM file is a windows menu source file and it holds the description related to events and elements. Below is shared an example of simple menu with just one element for understanding the whole picture:
$PBExportHeader$simple_menu.srm
forward
globalTYPEsimple_menuFROM menu
ENDTYPE
TYPEm_aboutFROM menu WITHINsimple_menu
ENDTYPE
END forward
globalTYPEsimple_menuFROM menu
ENDTYPE
globalsimple_menusimple_menu
ONsimple_menu.CREATE
simple_menu=this
CALL super::CREATE
this.m_about=CREATEm_about
this.Item[UpperBound(this.Item)+1]=this.m_about
ENDON
TYPEm_aboutFROM menu WITHINsimple_menu
ENDTYPE
ONm_about.CREATE
CALL super::CREATE
this.text=”&About”
ENDON
eventclicked;OPEN(simple_about)
END event
Here the SRM File is turned intoSystem.WEB.UI.usercontrol Class.
public partial class _simple_menu:System.Web.UI.UserControl
{
protectedvoidPage_Load(object sender, EventArgs e)
{
}
}
All the menu elements are converted to asp:Menu and asp:MenuItem Controls and then they are added to ASPX:


Orientation=”Horizontal”>


navigateurl=”simple_about.aspx”>

The event elementrequestsmethod to open simple_about page:

eventclicked;OPEN(simple_about)
END event

And this results to the conversion of method tonavigateurl=”simple_about.aspx”.

4. In the final stage convert data window (.SRD) to ASPX

release10.5;
datawindow(…)

TABLE(COLUMN=(TYPE=CHAR(200)updatewhereclause=yes
name=name dbname=”simple_demo.name”)
COLUMN=(TYPE=long updatewhereclause=yes
name=age dbname=”simple_demo.age”)
retrieve=”PBSELECT( VERSION(400) TABLE(NAME=~”simple_demo~” )
COLUMN(NAME=~”simple_demo.name~”)
COLUMN(NAME=~”simple_demo.age~”)) “)

SRD file gets converted to ASPX file using the help of GridView Control:

<asp:GridView ID=”dw_1″runat=”server”AutoGenerateColumns=”False”
DataSourceID=”d_simple_demo” Width=”201px”>
<Columns>
<asp:BoundFieldDataField=”name”HeaderText=”Name”
SortExpression=”name”/>
<asp:BoundFieldDataField=”age”HeaderText=”Age”
SortExpression=”age”/>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID=”d_simple_demo”runat=”server”
SelectCommand=”SELECT [name], [age] FROM [simple_demo]”>
</asp:SqlDataSource>

And in the end control declare is converted into designer class:

public partial class _simple_demo_main
{
protectedSystem.Web.UI.WebControls.GridView dw_1;
protectedSystem.Web.UI.WebControls.SqlDataSourced_simple_demo;
}

Know the reason of SQLWays preference

The prime reason behind opting for SQLWays is that using it removal of risks is an added advantage and much of the efforts get reduced. This makes the application migration tool hot favorite among developers.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s