PreviousNext
Help > Easycom .NET > Using Easycom for .NET > Using Easycom in a .NET development environment
Using Easycom in a .NET development environment

To use Easycom in a .NET environment you need to reference the main assembly of Easycom For .NET.

 

The assembly name is 'System.Data.EasycomClient'.

 

So you need to declare a reference to this assembly 'System.Data.EasycomClient'. If the assembly does not appear in the list, you can manually select the assembly DLL :

          Program Files (x86)\Easycom. NET\System.Data.EasycomClient.dll

 

The assembly 'System.Data.EasycomClient' contains the 2 main following namespaces:

                      1) Easycom: methods to implement AS/400 specific tasks

                      2) System.Data.EasycomClient: contains some inherited classes that makes

                      Easycom .NET an ADO.NET compatible assembly.

So, for some topics that may miss from this documentation please refer to an ADO.NET documentation.

                                 

 

Then you should be able to instantiate some Easycom .NET classes which are for instance:

 

EacConnection (implements System.Data.IDbConnection)

EacTransaction (implements System.Data.IDbTransaction)

EacCommand  (implements System.Data.IDbCommand)

EacDataReader (implements System.Data.IDataReader)

EacDataAdapter (implements System.Data.IDbDataAdapter)

EacParameterCollection 

EacParameter

  

First you must instantiate an EacConnection Object. Then you can create the other objects linked to it. At this point you can choose between generic or specific coding (using interfaces or using EacXX classes).

 

For example, in C# coding:

 

EacConnection mySqlConnection = new EacConnection();

mySqlConnection.Open();

 

EacCommand mySqlCommand = mySqlConnection.CreateCommand();

mySqlCommand.CommandText = "select * from s_customer order by Cust_id";

 

EacDataReader myReader = (EacDataReader) mySqlCommand.ExecuteReader();

[…] use myReader…

 

 

Example, in VB coding:

 

Dim mySqlConnection As EacConnection

mySqlConnection = New EacConnection

mySqlConnection.Open()

 

Dim mySqlCommand As EacCommand

mySqlCommand = mySqlConnection.CreateCommand()

mySqlCommand.CommandText = "select * from s_customer order by Cust_id"

 

Dim myReader As EacDataReader

myReader = mySqlCommand.ExecuteReader()

[…] use myReader…

 

 

This is even possible to do it at runtime (because the only difference is when creating the IDbConnection-derivated object).