Configuring the Language and Database Connection for V3

Overview

When any V3 application is run, before a user logs in, then the CCLAS EL application settings file is used to establish:

  • The language in which screen prompts and error messages are displayed on the user interface.
  • The database connection from the workstation to the CCLAS EL server.
  • The URL of the CCLAS EL software legal disclaimer.

When CCLAS EL V3 is first installed, the CCLAS EL initialisation file must be updated to configure these details.

After a user logs in, the user's Language CCLAS program setting is used to establish the language in which screen prompts and error messages are displayed on the user interface.

Process

Location of the appsettings.json File

The system looks for the appsettings.json file in the CCLAS EL V3 Exe folder.

Structure of the appsettings.json File

Example of an appsettings.json file:

Copy

appsettings.json

{
  "CCLASConfiguration": {
    "PreferredConnections": {
        "DESKTOP-JAVETBN": "CCLAS"
    },
    "Connections": {
      "CCLAS": {
        "Language": 0,
        "ConnectionName": "CCLAS_GENERIC",
        "ConnectionString": "Server=DESKTOP-JAVETBN;Database=CCLAS_GENERIC;Encrypt=false;Trust Server Certificate=Yes",
        "Uid": "CCLASMGR",
        "Pwd": "myPasword"
      }
      "TEST": {
        "Language": 0,
        "ConnectionName": "CCLAS_TEST",
        "ConnectionString": "Server=DESKTOP-JAVETBN;Database=CCLAS_TEST;Encrypt=false;Trust Server Certificate=Yes",
        "Uid": "CCLASTEST",
        "Pwd": "testPasword"
      }
    },
    "LegalDisclaimerURL": "https://www.dataminesoftware.com/terms-and-conditions/"
  }
}

All of the possible connections are defined in the "Connections" section. The "CCLAS" section within the Connections section is the default connection.

The "PreferredConnections" section is the connection that is the current connection for the workstation. In the advent that a preferred connection is not defined, then the CCLAS one is used.

Where neither a "PreferredConnections" or "CCLAS" section is defined, then a dialog box displays for you to enter connection details.

Note: The Server set in the ConnectionString contains the SQL server name, whereas the PreferredConnections contains the computer name. For example, a server name could be DESKTOP-F8AMUA7\\SQLEXPRESS, whereas the preferred connection could be DESKTOP-F8AMUA7. This example shows the server name containing a backslash. Where a backslash is used in the server name, it must be escaped with another backslash so that it is taken literally.

The appsettings.json file, and the CCLAS.INI file, can be changed via the user interface:

  • Where the cclasellogon > CCLAS EL login Form is displayed for you to log into CCLAS EL V3, then you can view the terms and conditions of using the CCLAS EL application, or access the Pool Control application to stop the current database connection or set another CCLAS EL database defined in the appsettings.json file as the preferred database. Refer to Logging In To a Laboratory.

  • After login, you can also stop or set a different database as the preferred database from the V3 application main menu. Refer to Changing the Database Connection.

  • Any change to a different database automatically updates your appsettings.json file for V3 and CCLAS.INI for V2. Where a connection exists in the appsettings.json file but not in the CCLAS.INI, then an error is raised: Section '<connection>' not found in configuration. Typically these initialisation files should be configured to contain the same available database connections. Refer to Configuring the Language and Database Connection for V3.

What Happens if the appsettings.json File is Not Configured

If a user launches CCLAS EL V3 and the appsettings.json file is missing or not configured properly, then the user is presented with the following screen to enter the Connection String, User Id and Password.

Language

Whilst the appsettings.json file can set the default language for screen prompts and error messages, it is possible to change the language via the V3 Menu.

Refer to Using the V3 Menu.