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.
- Open a Remote Desktop connection.
- Connect to the server the database resides on.
- Open Internet Information Services (IIS).
- Expand the SQL Server that you are connected to, then expand Sites.
- Right-click on the database name you are connected to and select Explore.
- In Windows Explorer, scroll to the bottom and open the WebConfig file.
- Scroll until you find the Connection String information, such as:
<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.
<add name="FormsDB" connectionString="Data Source=XXXSQL02;Initial Catalog=XXXXXXXXXXXXXXX;User=Admin;Password=Password123!;Integrated Security=False;Encrypt=False;TrustServerCertificate=False;" />
</connectionStrings>
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. - Copy the user and password in the connection string and paste that information into Username and Password fields in the Connection window.
- 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; - Paste this connection string in the Connection String field in the Connection window.
- Remove the username and password information from the connection string.
- Click Test Connection to ensure the connection is valid.
- Click Save to save the connection.