Determining a SQL Server Connection String

How to determine a SQL Server connection string

When setting up a SQL Server data connection, the Connection String field in the Connection window is where you enter the client application to connect to a SQL Server database. The following describes how to find this connection string information. Keep in mind this is an example and may vary for your specific situation.

  1. Open a Remote Desktop connection.
  2. Connect to the server the database resides on.
  3. Open Internet Information Services (IIS).
  4. Expand the SQL Server that you are connected to, then expand Sites.
  5. Right-click on the database name you are connected to and select Explore.
  6. In Windows Explorer, scroll to the bottom and open the WebConfig file.
  7. Scroll until you find the Connection String information, such as:

    <connectionStrings>
        <add name="FormsDB" connectionString="Data Source=XXXSQL02;Initial Catalog=XXXXXXXXXXXXXXX;User=Admin;Password=Password123!;Integrated Security=False;Encrypt=False;TrustServerCertificate=False;" />
      </connectionStrings>

    Data Source specifies the server or host where the database is located. In this example, XXXSQL02 is the SQL Server instance being connected to.
    Initial Catalog specifies the database you want to connect to on the SQL Server. 
    Integrated security=False means that Windows Authentication is not used for this connection. SQL Server Authentication is used, and you will need to provide a username and password.
    Encrypt=False "tells" the client to not encrypt the data that is transmitted between the application and the SQL Server.
    TrustServerCertificate=False means the client will not trust the server's certificate unless it's properly signed by a trusted authority. If it's true, it bypasses the certificate validation.
  8. Copy the user and password in the connection string and paste that information into Username and Password fields in the Connection window.
  9. Next, copy the connection string from Data Source to the colon, such as:
    Data Source=XXXSQL02;Initial Catalog=XXXXXXXXXXXXXXX;User=Admin;Password=Password123!;Integrated Security=False;Encrypt=False;TrustServerCertificate=False;
  10. Paste this connection string in the Connection String field in the Connection window.
  11. Remove the username and password information from the connection string.
  12. Click Test Connection to ensure the connection is valid.
  13. Click Save to save the connection.