WCF Functions


All XML streams are described in detail here.
Create connection strings

GetConnectionString(ByVal IP, ByVal userName, ByVal password)

Description:
LINK2i functions require an encrypted connection string containing the IP address of the targeted IBM i partition and IBM i session credentials (username/password). This connection string is generated using GetConnectionString. The IBM i access is limited to the security roles established in the IBM i for the specified account.

Returns:
LINK2i connection string as string
Error message on failure as String

Parameter Type Description
IP String (ByVal) IP address or network location of the targeted IBM i partition
userName String (ByVal) User name of an IBM i account
password String (ByVal) Password corresponding to the username

Explore targeted IBM i partition

These functions allow you to explore the targeted IBM i partition to get a quick in-depth overview of what's inside your machine. They can also be used to interact with other LINK2i functions to specify libraries, files, create user-friendly query wizards...

GetSerialNumberIBMi(ByVal connString, ByVal sessionID, ByRef licenseStatus)

Description:
The result contains the system name, the OS version and processor group.

Returns:
IBM i information as string
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days

ListDatabases(ByVal connString, ByVal sessionID, ByRef licenseStatus)

Description:
ListDatabases extracts a list of all databases/libraries from the targeted IBM i partition as an XML string.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days

ListTables(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base)

Description:
ListTables extracts a list of all tables/files of the specified database/library from the targeted IBM i partition as an XML string.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Name of the database/library whose tables/files are to be listed

ListFields(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal table, ByRef recCount)

Description:
ListFields extracts a list of all fields of the specified table/file of the specified database/library from the targeted IBM i partition as an XML string.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library containing the table/file whose fields are to be listed
table String (ByVal) Table/file whose fields are to be listed
recCount String (ByRef) Returned by ref, number of records in the table/file

ListPrograms(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base)

Description:
ListPrograms extracts a list of all programs of the specified database/library from the targeted IBM i partition as an XML string.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library whose programs are to be listed

ListSources(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base)

Description:
ListSources extracts a list of all source files of the specified database/library from the targeted IBM i partition as an XML string.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library whose source files are to be listed

ListMembers(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal srcFile)

Description:
ListMembers extracts a list of all members of the specified source file of the specified database/library from the targeted IBM i partition as an XML string.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library whose members are to be listed
srcFile String (ByVal) Source file whose members are to be listed

GetObjectDetails(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal ibmObject, ByVal objType)

Description:
GetObjectDetails retreives details of any IBM i object as an XML string. It can be used with gridView and formView objects to display object details in a 5250 like interface.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library containing the IBM i object
ibmObject String (ByVal) IBM i object Name
objType String (ByVal) IBM i object type (*PGM, *FILE, *DEVD, etc...)

Database

Run SQL queries and retreive data in standard structures (XML, DataTable objects) to integrate DB2 for i databases in any environment. Extract and export data in CSV, TXT and XLSX files.

RunSql(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery)

Description:
Runs an SQL query on the targeted IBM i.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL query to execute

RunSqlByTen(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery)

Description:
Runs a sequence of up to 10 SQL queries in a row. Each query of the sequence must be separated by a semicolumn ( ; )

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal)

RunSqlScript(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlScript)

Description:
Runs an SQL script. Each instruction of the script must be separated by a semicolumn ( ; )

Returns:
Messages returned at each step of the script as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlScript String (ByVal) SQL script to execute

GetRecordCount(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByRef errMessage)

Description:
Counts records in the result of an SQL SELECT query (simple/join)

Returns:
Number of records as Integer

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query from which to count (simple/join)
errMessage String (ByRef) Returned by ref, error/success message

GetAllRecords(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal keyField, ByVal nbrRec, ByRef xmlStr, ByRef errMessage)

Description:
Retreives the result of an SQL SELECT query (simple/join) as a System.Data.DataTable object.

Returns:
XML data as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query (simple/join)
keyField String (ByVal) Complement to SQL ORDER BY statement. Fields separated by commas, can be followed by ASC or DESC (ex:'Field1 DESC, Field2, Field3 DESC')
nbrRec Integer (ByVal) Number of records to extract
xmlStr String (ByRef) Returned by ref, raw data formatted in XML
errMessage String (ByRef) Returned by ref, error/success message

CopyToCSV(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal dirPath, ByVal outputFileName)

Description:
Exports the result of an SQL SELECT query (simple/join) in a CSV file.
The maximum size of a file is 1 million records. Multiple files are created when exporting more than 1 million records.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query to execute
dirPath String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
outputFileName String (ByVal) Name of the resulting csv file

CopyToTXT(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal dirPath, ByVal outputFileName)

Description:
Exports the result of an SQL SELECT query (simple/join) in a TXT file, keeps IBM i original tabulations for a clear & quick overview of data.
The maximum size of a file is 1 million records. Multiple files are created when exporting more than 1 million records.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query to execute
dirPath String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
outputFileName String (ByVal) Name of the resulting txt file

CopyToXLSX(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal dirPath, ByVal outputFileName)

Description:
Exports the result of an SQL SELECT query (simple/join) in an Excel file (XLSX), recommended for up to a few thousands of records.
The maximum size of a file is 1 million records. Multiple files are created when exporting more than 1 million records.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query to execute
dirPath String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
outputFileName String (ByVal) Name of the resulting xlsx file

GetMassData(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal delimiter, ByVal nbrRec, ByVal resultFilePath, ByVal chunk)

Description:
Performs mass data extraction to CSV file. GetMassData retreives detailed description of each fields in the header of the file.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query (simple/join)
delimiter String (ByVal) CSV separator
nbrRec Integer (ByVal) Number of records to extract
resultFilePath String (ByVal) Full path to the result file
chunk Integer (ByVal) Chunking parameter affecting the overall speed of the process. Find more details here

GetRecordFields(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal keyField, ByVal sqlQuery, ByVal fieldName)

Description:
Retreives specified fields of the first record returned by an SQL SELECT query (simple/join).

Returns:
Fields values separated by semiculumns ( ; ) as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
keyField String (ByVal) key(s) field(s) of the table separated by a comma
sqlQuery String (ByVal) SQL SELECT query (simple/join)
fieldName String (ByVal) this parameter contains the name of the field to retrieve

GetRecord(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal keyField, ByVal sqlQuery, ByRef data)

Description:
Retreives all fields of the first record returned by an SQL SELECT query (simple/join).

Returns:

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
keyField String (ByVal) key(s) field(s) of the table separated by a comma
sqlQuery String (ByVal) SQL SELECT query (simple/join)
data List(Of String) (ByRef) the « System.Collections.Generic.List (Of String) » type structure which retrieves the data

Programs

These functions allow you to run existing IBM i programs from .NET environments, perform joint develoment and run ILE modules. You can also retreive, edit and recompile programs using Excel/text files.

RunProgram(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal library, ByVal pgmName)

Description:
RunProgram executes a program on the targeted IBM i without parameter.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
library String (ByVal) Name of the IBM i library/database that contains the program
pgmName String (ByVal) Name of the IBM i program to launch

RunProgramParam(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal library, ByVal pgmName, ByRef prmList, ByVal prmLength, ByVal delimiter)

Description:
RunProgramParam executes a program on the targeted IBM i with input parameters.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
library String (ByVal) Name of the IBM i library/database that contains the program
pgmName String (ByVal) Name of the IBM i program to launch
prmList String (ByRef) List of parameters values (input and output) as a list. More details about passing parameters here
prmLength String (ByVal) List of parameters sizes (input and output) as a list. More details about passing parameters here
delimiter String (ByVal) Delimiter used in parameter lists

RunProgramParamReturn(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal library, ByVal pgmName, ByRef prmList, ByVal prmLength, ByVal prmReturned, ByVal delimiter)

Description:
RunProgram executes a program on the targeted IBM i with input and returned parameters.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
library String (ByVal) Name of the IBM i library/database that contains the program
pgmName String (ByVal) Name of the IBM i program to launch
prmList String (ByRef) List of parameters values (input and output) as a list. More details about passing parameters here
prmLength String (ByVal) List of parameters sizes (input and output) as a list. More details about passing parameters here
prmReturned String (ByVal) Position in prmList of the parameters to be returned. More details about passing parameters here
delimiter String (ByVal) Delimiter used in parameter lists

RunILEModule(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal Library, ByVal pgmName, ByVal modules, ByVal currentLibrary, ByVal listLibrary)

Description:
RunModuleILE executes ILE modules on the targeted IBM i.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
Library String (ByVal) Name of the IBM i library/database that contains the temporary program to run ILE module
pgmName String (ByVal) Name of the IBM i temporary program
modules String (ByVal) List of ILE modules to run, in Library/Module form (from 1 to 300 modules separated by a space)
currentLibrary String (ByVal) Currency library to run temporary program
listLibrary String (ByVal) Additional library referenced to run temporary program

GetSourceXLSX(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal srcFile, ByVal member, ByVal dirPath, ByVal outputFileName)

Description:
GetSourceXLSX retreives a source file from the targeted IBM i as an XLSX file.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library whose members are to be listed
srcFile String (ByVal) Source file whose members are to be listed
member String (ByVal) Name of the member to export as an xlsx file
dirPath String (ByVal) Directory path where the source file has to be extracted on the Windows machine (uses '\' and must finish by '\')
outputFileName String (ByVal) Name of the excel file

GetSourceTXT(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal srcFile, ByVal member, ByVal dirPath, ByVal outputFileName)

Description:
GetSourceTXT retreives a source file from the targeted IBM i as an text file.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Database/library whose members are to be listed
srcFile String (ByVal) Source file whose members are to be listed
member String (ByVal) Name of the member to export as a text file
dirPath String (ByVal) Directory path where the source file has to be extracted on the Windows machine (uses '\' and must finish by '\')
outputFileName String (ByVal) Name of the text file

PostSource(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal srcFile, ByVal member, ByVal memberDescription, ByVal filePath, ByVal srcType)

Description:
Copies a source member from an Excel file to specified database/library and file in the targeted IBM i. The excel workbook to apply has to be formatted as GetSourceXLSX result files.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Library/database where to post the source member
srcFile String (ByVal) Source file where to post the source member
member String (ByVal) Name of the new member
memberDescription String (ByVal) Short description of the new member (max 72 characters)
filePath String (ByVal) Full path of the Xlsx file of the member to send
srcType String (ByVal) Type of source (RPG or CLP)

CreateProgram(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal base, ByVal srcFile, ByVal member, ByVal srcType, ByVal destBase, ByVal pgmName)

Description:
CreateProgram compiles a member of the targeted IBM i into a program.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
base String (ByVal) Type of source to compile (RPG, CBL, CLP etc...)
srcFile String (ByVal) Name of the source file for which a source member is compiled
member String (ByVal) Name of the source member to compile
srcType String (ByVal) Type of source to compile (RPG, CBL, CLP etc...)
destBase String (ByVal) Name of the destination database/library of the compiled program
pgmName String (ByVal) Name of the compiled program

CL commands from .Net

Run CL commands from .NET

RunCLCmd(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal cmd)

Description:
Executes any CL command from .NET

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
cmd String (ByVal) Command to execute

Using Excel

Use Excel as an input-output peripheral to manually create, edit or delete data

XlsxUpdate(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal keyField, ByVal dirPath)

Description:
Exports an Excel workbook that can be used to manually edit records, and posted back for update to the targeted IBM i using XlsxApply function.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Current HTML Session ID or custom session identifier
sessionID String (ByVal) Returned by ref, status of the LINK2i licence in remaining days
licenseStatus String (ByRef) SQL SELECT query to execute
sqlQuery String (ByVal) Complement to SQL ORDER BY statement. Fields separated by commas, can be followed by ASC or DESC (ex:'Field1 DESC, Field2, Field3 DESC')
keyField String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
dirPath String (ByVal) Name of the resulting xlsx file

XlsxCreate(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal keyField, ByVal dirPath)

Description:
Exports an Excel workbook that can be used to manually add records, and posted back for update to the targeted IBM i using XlsxApply function.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Returned by ref, status of the LINK2i licence in remaining days
licenseStatus String (ByRef) SQL SELECT query to execute
sqlQuery String (ByVal) Complement to SQL ORDER BY statement. Fields separated by commas, can be followed by ASC or DESC (ex:'Field1 DESC, Field2, Field3 DESC')
keyField String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
dirPath String (ByVal) Name of the resulting xlsx file

XlsxCreateWithGeneric(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal keyField, ByVal dirPath)

Description:
Exports an Excel workbook that can be used to manually add records, and posted back for update to the targeted IBM i using XlsxApply function.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) SQL SELECT query to execute
sqlQuery String (ByVal) Complement to SQL ORDER BY statement. Fields separated by commas, can be followed by ASC or DESC (ex:'Field1 DESC, Field2, Field3 DESC')
keyField String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
dirPath String (ByVal) Name of the resulting xlsx file

XlsxDelete(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal sqlQuery, ByVal keyField, ByVal dirPath, ByVal outputFileName)

Description:
Exports an Excel workbook that can be used to manually delete records and posted back for update to the targeted IBM i using XlsxApply function.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
sqlQuery String (ByVal) SQL SELECT query to execute
keyField String (ByVal) Complement to SQL ORDER BY statement. Fields separated by commas, can be followed by ASC or DESC (ex:'Field1 DESC, Field2, Field3 DESC')
dirPath String (ByVal) Path of the directory to export files into, uses '\' directories delimiter and ens by '\'
outputFileName String (ByVal) Name of the resulting xlsx file

XlsxApply(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal resultFilePath)

Description:
Applies Excel workbooks generated by XlsxUpdate, XlsxCreate, XlsxCreateWithGeneric and XlsxDelete functions.

Returns:
Error/success message as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
resultFilePath String (ByVal) Full path of the file to apply, using '\' as directory delimiter

Utility functions

These functions provide you with an out-of-the-box user interface to work with your data. Display and edit data from an ASP.NET page as you would do on a 5250 screen. Go further and exploit XML data to build your own user interfaces to master your data.

UtilityDisplayGet(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal keyField, ByVal sqlQuery)

Description:
Displays the first record returned by an SQL SELECT Query (simple/join) as an XML string used to display records only.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
keyField String (ByVal) key(s) field(s) of the table separated by a comma
sqlQuery String (ByVal) SQL SELECT query (simple/join)

UtilityUpdateGet(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal keyField, ByVal sqlQuery)

Description:
Displays the first record returned by an SQL SELECT Query (simple) as an XML string used to manually edit records only.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
keyField String (ByVal) key(s) field(s) of the table separated by a comma
sqlQuery String (ByVal) SQL SELECT query (simple/join)

UtilityCreateGet(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal keyField, ByVal sqlQuery)

Description:
Displays a blank record formatted according to an SQL SELECT Query (simple) as an XML string, to manually add records only.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
keyField String (ByVal) key(s) field(s) of the table separated by a comma
sqlQuery String (ByVal) SQL SELECT query (simple/join)

UtilityDeleteGet(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByVal keyField, ByVal sqlQuery)

Description:
Displays the first record returned by an SQL SELECT Query (simple) as an XML string, to manually delete records only.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
keyField String (ByVal) key(s) field(s) of the table separated by a comma
sqlQuery String (ByVal) SQL SELECT query (simple/join)

UtilityUpdatePost(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByRef xmlStr)

Description:
Applies altered XML String (updates a record) originally obtained by UtilityUpdateGet function.

Returns:
Error message on failure as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
xmlStr String (ByRef) XML string returned by UtilityToXML or Utility…GetXML functions

UtilityCreatePost(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByRef xmlStr)

Description:
Applies altered XML String (creates a new record) originally obtained by UtilityCreateGet function.

Returns:
Error message on failure as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
xmlStr String (ByRef) XML string returned by UtilityToXML or Utility…GetXML functions

UtilityDeletePost(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByRef xmlStr)

Description:
Applies altered XML String (deletes selected record) originally obtained by UtilityDeleteGet function.

Returns:
Error message on failure as string

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
xmlStr String (ByRef) XML string returned by UtilityToXML or Utility…GetXML functions

UtilityCLCmdGet(ByVal connString, ByVal sessionID, ByRef licenseStatus, ByRef cmd, ByRef nbItems)

Description:
Retreives XML string used to compose a CL command with a 5250-like interface in an ASP.NET web page.

Returns:
XML data as String
Error message on failure as String

Parameter Type Description
connString String (ByVal) Encrypted connection string (obtained with GetConnectionString function)
sessionID String (ByVal) Current HTML Session ID or custom session identifier
licenseStatus String (ByRef) Returned by ref, status of the LINK2i licence in remaining days
cmd String (ByRef) CL command to get a prompt from
nbItems String (ByRef) Number of items in the command

UtilityCLCmdBuild(ByVal xmlStr)

Description:
Generates a valid CL command ready to be executed using RunCLCmd function from an XML string retreived by UtilityCLCmdGet function and edited by the user.

Returns:
CL Command as String
Error message on failure as String

Parameter Type Description
xmlStr String (ByVal) In this case, the character string is not XML formatted.

Data conversion

A set of utility functions for data conversion (date formats and ASCII/EBCDIC).

ConvertTime(ByVal inputStr)

Description:
Convert time from IBM i to .NET format.

Returns:
Time as String
Error message on failure as String

Parameter Type Description
inputStr String (ByVal) String to translate from DB2 time to .NET time

ConvertDate(ByVal inputStr)

Description:
Convert date from IBM i to .NET format.

Returns:
Date as String
Error message on failure as String

Parameter Type Description
inputStr String (ByVal) String to translate from DB2 date to .NET date

ConvertTimeStamp(ByVal inputStr)

Description:
Convert timestamp from IBM i to .NET format.

Returns:
TimeStamp as String
Error message on failure as String

Parameter Type Description
inputStr String (ByVal) String to translate from DB2 timestamp to .NET time

ConvertEbcdicToAcscii(ByVal inputStr)

Description:
Cleans EBCDIC string to ASCII translations

Returns:
Converted ASCII String
Error message on failure as String

Parameter Type Description
inputStr String (ByVal) String to translate from ASCII to EBCDIC

ConvertEbcdicToAsciiCSV(ByVal inputStr)

Description:
Cleans EBCDIC string to ASCII translations without altering semicolumns ( ; )

Returns:
Converted ASCII String
Error message on failure as String

Parameter Type Description
inputStr String (ByVal) CSV string to translate from ASCII to EBCDIC