Accessing Databases with Connection Strings

Another method of connecting to a database is using a connection string. A connection string is a string that contains information about a data source (usually a database engine), as well as the information necessary to connect to it. While the exact syntax of a connection string varies depending on the data source (for example, a connection string meant to connect to a MySQL database server will look different than one for a PostgreSQL server), you will usually be required to specify the following data:

This document does not aim to provide an in-depth description of connection strings’ syntax. If you want to learn more about the subject, we recommend that you visit https://msdn.microsoft.com/en-us/library/windows/desktop/ms722656%28v=vs.85%29.aspx for more information.