SQL Server database connection string statement

Source: Internet
Author: User
Tags account security

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.