connectionStrings.config

<< Click to Display Table of Contents >>

Navigation:  Administration and Configuration > App Config Files >

connectionStrings.config

The connectionStrings.config file is typically found in the \Program Files\EarthSoft\Enterprise7\bin\ folder. The web.config file, the EarthSoft.Workflow.Service.exe.config file, and the register.exe.config file reference the connectionStrings.config file as the shared source for database connections. The connectionStrings.config file manages one or more connections. If there is only one entry as shown in the following example, the value of the name attribute should be "localhost". In this configuration, the name "localhost" will match any URL.

 

Default File

 

<connectionStrings>

 <clear/>

 <!-- Enter your EQuIS database connection string information here -->

  <!-- Example:  connectionString="Data Source=localhost;User ID=username;Password=pwd;Database=demo;" -->

 <add name="localhost" connectionString="" providerName="EarthSoft.Common.Data.SqlConnection" />

</connectionStrings>

 

Note: An ampersand (&) should not be used in the password for the connectionString.

 

If more than one name entry is present, the value of the name attribute must be a unique URL fragment for the web application. No name attribute value may be a sub-string of another entry.

 

Example:

These entries are unwise since the second entry is a sub-string of the first, and therefore, the search is ambiguous.

<add name="servername/equis7"...

<add name="servername/equis"...

 

These entries are valid URL fragments

<add name="servername/pathA"...

<add name="servername/pathB"...

 

 

The attribute providerName must be the following value: EarthSoft.Common.Data.SqlConnection

 

The attribute connectionString may be any valid ADO.Net connection string value. See SqlConnection.ConnectionString for more information.

 

Note: When connecting to a self-hosted SQL Server instance that is not configured with a SSL certificate issued by a known certificate authority (CA), you must include the advanced connection parameter "TrustServerCertificate=True;" in your connection string.

 

If the process opening the connectionStrings.config file has write permission on the file, the connection string will be encrypted and written back the first time the entry is used.

 

Using Windows Authentication in a Connection String

 

The connection string in connectionStrings.config may use Windows Authentication (e.g. "Trusted_Connection=Yes;") as long as the IIS Application Pool identity and the Workflow Windows Service are set to an Active Directory domain account that is properly permissioned in SQL Server. An example of these steps is provided below:

 

1. Create the Active Directory account, e.g. "EQuISADAcct".

2. Add EQuISADAcct domain account as a login with at least db_datareader and db_datawriter permissions to the EQuIS database(s).

3. Change the connection string in connectionStrings.config to use "Trusted_Connection=Yes;" instead of user ID and password.

4. In IIS, configure the EQuIS web application's application pool identity to be EQuISADAcct.

5. In Windows Services, configure the account that runs the Workflow Service to be EQuISADAcct.

6. Restart the application pool and service.

 

NOTE: If you are using ALS roles, you will need to configure those ALS role connection strings as well:

Windows Domain Groups for ALS Users

 

 

Examples

 

<connectionStrings>

 <clear/>

 <!-- Enter your EQuIS database connection string information here -->

  <!-- Example:  connectionString="Data Source=localhost;User ID=username;Password=pwd;Database=demo;" -->

 <add name="subdomain1.example.com/SQL" connectionString="Data Source=SQLDB01;User ID=equis_svc;Password=jX45*so36WV7pH;Database=subdomain1;pooling=true;Connection Timeout=600;" providerName="EarthSoft.Common.Data.SqlConnection" />

 <add name="subdomain2.example.com/SQL2" connectionString="Data Source=SQLDB02;User ID=equis_svc;Password=jX45*so36WV7pH;Database=subdomain2;pooling=true;Connection Timeout=600;" providerName="EarthSoft.Common.Data.SqlConnection" />

 <add name="subdomain3.example.com/SQL3" connectionString="f9oeH5Pss59nf39SSV1ksu5lOS79Bys4GS3fo4D" providerName="EarthSoft.Common.Data.SqlConnection" />

</connectionStrings>