PreviousNext
Help > Easycom .NET > System.Data.EasycomClient namespace > EacConnection > EacConnection properties > EacConnection.ConnectionString
EacConnection.ConnectionString

 

public string ConnectionString [ get, set ]

 

This property is designed to set-up connection-related properties before calling the IDbConnection.Connect() method.

 

The available key words are:

 

     Server: The name or the IP address of the AS/400

     User ID: The user profile. In interactive environment, if this parameter is omitted an Easycom dialog box will be shown. If this parameter is omitted in a service like program (for example in ASP.NET environment), an exception will be thrown during the connection.

     Password: The password that belongs the User ID.

     Init Libl: Some libraries to add to the default library list (that belong to the user ID). This is a semicolon-separated list, such as "MYLIB1;MYLIB2".

     JobName: The job name to use. By default this is the name of the PC.

     EacUnLock: A special password that can be validated by a user-defined AS/400 program. This avoids to non-authorized developers to use Easycom. See 'Advanced security features' in the server documentation.

     CodepageFile: designates an ASCII-EBCDIC translation file. This is mostly useful for DBCS countries like China, Japan, Korea.

     ShortFieldNames: tells Easycom to use only short forms for field names. This will ignore aliases of columns. Valid values are 'True' and 'False'. Default value is False.

     SqlNaming: Choose between '.' and '/' to separate files and libraries. When using '.' the library list is not available (and current library is the name of the user). Possible values are '/' and '.'. Default is '/'.

     Pooled: Choose if pooling or not this connection object. See 'Pooling connection' topic for more details. Possible values are 'True' and 'False'. Default value is True.

     PoolLimit: Determines the limit of using pooled connection. When the limit is reached the thread will wait until a pooled connection is available or until the timeout is reached (see PoolTimeout parameter and 'Pooling connections' topic for more details). Non-pooled connections are not counted with this parameter. This value is an integer representing the maximum number of connections being pooled. Default is 0 (unlimited). Windows only.

     PoolTimeout: Represents the maximum number of seconds to wait if the pool limit is reached. Default value is 0 (unlimited). Windows only.

     Shared: Choose if sharing the connection for the same thread. Possible values are 'True' and 'False'. Default value is False.

          CommandTimeout: The CommandTimeout is configurable for a given connection.
If the timeout is reached for a command, the following Easycom exception is raised:
{"Easycom error, Generic error: Timeout has been reached."}

Example with Timeout = 120s:

Connection.ConnectionString = "Server=" + "power8" + ";User Id=" + "aura" + ";Password=" + "aura" + ";CommandTimeout=120"

 

The ConnectionString value is a semicolon separated list of parameters. The value is read/write when the connection is closed and read-only when the connection is opened.

 

The value of the ConnectionString may change to fit a standard syntax and if some parameters are not recognized (i.e., you may not retrieve the value you have put). When developing you can read back the ConnectionString value to check if all parameters are understood as expected.

Example of usage (C#) :

 

EacConnection cnx;

cnx = new EacConnection();

cnx.ConnectionString ="User Id=qpgmr;Password=qpgmr;Init Libl=

cnx.Open();

 

Example of usage (VB) :

 

Dim cnx As EacConnection

cnx = New EacConnection

cnx.ConnectionString ="User Id=qpgmr;Password=qpgmr;Init Libl=

cnx.Open()