Commonly used declarations in connection strings include:
The server declares data source, server, and ADDR.
Database declaration initial catalog and database.
Integrated Windows Account Security statements, such as integrated security and trusted_connection.
Use the Security Statement of the database account, such as user ID and password.
For the account accessing the database, we usually see the string connection of ADO. Net in some references as follows:
String connstr = "Server = localhost; user id = sa; Password = xxx; database = northwind ";
For an account integrated with Windows security, the connection string is generally written as follows:
String connstr = "Server = localhost; Integrated Security = sspi; database = northwind ";
Or string connstr = "Server = localhost; trusted_connection = yes; database = northwind ";
Using Windows integrated security verification has many advantages in accessing the database: higher security, faster access, less security architecture re-design, hard-coded connection strings, etc, it is worth using.