Integration Security = SSPI/ture/false in SQL connection statements

Source: Internet
Author: User
Tags microsoft sql server management studio sql server management studio

Integration Security = SSPI/ture/false in SQL connection statements

Solution:
Security Support Provider Interface
When the value of Integrated Security is set to True, the user ID in front of the connection statement PW does not work, that is, the windows Authentication mode is used.
The connection is based on UserID and PW only when it is set to False or this item is omitted.
Integrated Security can be set to: True, false, yes, no. The four values are clear and can also be set to: sspi, which is equivalent to True. We recommend that you use this instead of True.

What is the difference between initial catalog and database?
Initial Catalog:
DataBase:
There is no difference between the two, but the names are different, just like the real names of humans and old names .. Can call you.

**************************************** ****

Integrated Security = SSPI indicates that the current WINDOWS system user logs on to the SQL server. If the SQL SERVER does not support this method, an error occurs.
You can use the username and password of SQL SERVER to log on, for example:
"Provider = SQLOLEDB.1; Persist Security Info = False; Initial Catalog = database name; Data Source = 192.168.0.1; User ID = sa; Password = Password"


**************************************** ***********

If the value of Integrated Security-or-Trusted_Connection 'false' is false, the user ID and password are specified in the connection. If this parameter is set to true, the current Windows Account creden。 are used for authentication. The identifiable values are true, false, yes, no, and sspi equivalent to true (strongly recommended ).


**************************************** *********

Database Connection Method in ADO.net
System. Data. SqlClient. SqlConnection
Commonly used connection strings (C # code ):

SqlConnection conn = new SqlConnection ("Server = (local); Integrated Security = SSPI; database = Pubs");

SqlConnection conn = new SqlConnection ("server = (local) \ NetSDK; database = pubs; Integrated Security = SSPI");

SqlConnection conn = new SqlConnection ("Data Source = localhost; Integrated Security = SSPI; Initial Catalog = Northwind;");

SqlConnection conn = new SqlConnection ("data source = (local); initial catalog = xr; integrated security = SSPI;
Persist security info = False; workstation id = XURUI; packet size = 4096; ");

SqlConnection myConn = new System. Data. SqlClient. SqlConnection ("Persist Security Info = False; Integrated
Security = SSPI; database = northwind; server = mySQLServer ");

SqlConnection conn = new SqlConnection ("uid = sa; pwd = passwords; initial catalog = pubs; data source = 127.0.0.1; Connect Timeout = 900");

Network-related or instance-specific errors occur when you establish a connection with SQL Server. The server is not found or cannot be accessed. Verify that the Instance name is correct and SQL Server is configured to allow remote connection. (Provider: named pipeline provider, error: 40-unable to open the connection to SQL Server)

If sql2000 is installed on your machine, Data Source =. Certainly not.
Because the default values of instance 2000 and 2005 are the same, 2005 instances cannot be represented by Data Source =.

Check the Instance name of sql2005 and replace SQLEXPRESS in Data Source =. \ SQLEXPRESS with your new instance name.

 

I installed the SQL Server 2005 EXPRESS database that comes with VS2008, so I wrote the Data Source:

Data Source =. \ SQLEXPRESS. The. number used before SQL2000 cannot be used on 2005.

Another problem today is that SQL 2005 EXPRESS enables the SA account. after half a day, I was unable to log on to SQL Server Management Studio Express. Even though I have enabled SA, I still cannot log on. Later, I set my identity authentication to SQL + Windows Authentication Mode to log on to SQL Server Management Studio Express.

VS2008 actually comes with a database and a database driver, which can be used for normal development and debugging. you cannot create tables because you do not have database management tools. In fact, Microsoft provides free management tools:

Install Microsoft SQL Server Management Studio Express to operate the database.

Download

The method for enabling SA is as follows: Enable MSE and use windows to verify logon,

 

 

In this way, you can use SA to log on. Of course, you can change your password.

Once the database is opened,. NET can be connected to the database for normal data access, so it will be much easier to develop later.

This article permanently updates the link address:

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.