Table of Contents
How To Migrate Progress 4GL to C# with Microsoft SQL Server Database Usage
To migrate Progress 4GL code to C# with Microsoft SQL Server usage in command line mode you can use Ispirer nGLFly tool or SQLWays.exe command line tool.
If you run the Ispirer nGLFly or SQLWays.exe tool for the first time, you need to register the tool using the license information that you have. You can register the toolkit using the SQLWays Wizard tool. Here you can find step by step guide on how to run and register the tool. Please follow the steps described in the article:
If you have Progress database, first of all you should convert this database to MS SQL Server one. Before you start Progress 4GL to C# conversion, you should create edmx model to get correct queries in C# results. For this purpose, you can use database file *.mdf or existing connection to database.
To create EDMX file you should:
- Open project in Visual Studio
- Perform right click on project item, select “Add” ⇒ “New Item”.
- Select “Data” and choose “ADO.NET Entity Data Model”
- Select “EF Designer from database”
- Select existing connection or create a new one using existing database or your *.mdf database file
- Select “Entity Framework 6.x
- Select all table, write Model Namespace and set other options as they are set on the picture below and press “Finish” button
After that you should go to the application folder in File Explorer, find *.edmx file and copy it to the folder with conversion sources. After that you should create a “db” folder, rename edmx file to DataClasses.edmx and put this file into “db” folder.
Conversion With Ispirer nGLFly Wizard
To use EDMX during conversion you should click “Advanced” button on “Target Options” page and set these options: - “DATA model used” to EDM - “ENTITY model name” to name that you use during saving connection settings to App.config. (f.e. DemoEntities) - “ENTITY model namespace” to value of Schema Namespace in edmx file in ConceptualModels section. (f.e. demoModel)
Other target options should be set as they are set in the screenshot below.
After you will get the results, you can add them to the project where you've been created edmx file and, if you do everything correct, you will have results that are connected to edmx model and database.
Conversion With Command Line
After you registered the toolkit you need to run the following command in the Command Prompt:
c:\Program Files\Ispirer\MnMTK10\SQLWays.exe" /D=FIXED /SOURCE= Progress 4GL /TARGET=CS /F=c:\example\*.* /DIR=ResultCS\ /INI=sqlways.ini
Description of the command line options:
- c:\Program Files\Ispirer\MnMTK10\SQLWays.exe - a path to the SQLWays.exe command line tool that will run the conversion.
- /F – a path to the source files that should be converted.
- /DIR - a path to the folder where the conversion results will be saved.
- /INI - a path to the options file (.INI file where all the options supported by Ispirer Migration And Modernization ToolKit are located).
- /SOURCE - option that defines a source technology (database or application).
- /TARGET - option that defines a target technology (database or application).
Options In the Options File
To convert your Progress 4GL source code, please specify the following options in the sqlways.ini file:
[COMMON] DSN=c:\Root\ SOURCE=Progress 4GL TARGET=CS TARGET_DB=Microsoft SQL Server [CS] ENTITY_MODEL_NAME=DemoEntities ENTITY_MODEL_NAMESPACE=demoModel DATA_MODEL=EDM
- DSN=c:\Root\ - a full path to source folder for correct coloring of call of functions from libraries.
- REGISTRATION_NAME= - is mandatory for your company.
- TARGET_DB= - specifies the target database.
- ENTITY_MODEL_NAME= - specifies the entities name that will be used in code.
- ENTITY_MODEL_NAMESPACE= - specifies the entities namespace that is set in edmx files in Schema Namespace inside ConceptualModules Section.
- DATA_MODEL=EDM - specifies the usage of entities framework for conversion.