sql connect statement in the Integrated Security = SSPI / ture / false
October 19, 2010
sql connect statement about the Integrated Security = SSPI
solution:
namely: Security Support Provider Interface < br />
Integrated Security set to True when the connect statement in front of UserID, PW does not work that uses windows authentication mode.
only set to False or omitted the time, only in accordance with UserID, PW to connect.
Integrated Security can be set to: True, false, yes, no, this is to understand the meaning of four, also can be set to: sspi, equivalent to True, suggested that instead of True.
initial catalog and database What is the difference
Initial Catalog:
DataBase:
there is no difference between the two just not the same name, just as human as the real name and former name. . Can tell you.
****************************************** **
Integrated Security = SSPI the said body of the current system users to log WINDOWS SQL SERVER server, if the server does not support SQL SERVER log in this way when an error occurs.
you can use SQL SERVER user name and password, such as:
“Provider = SQLOLEDB.1; Persist Security Info = False; Initial Catalog = database name; Data Source = 192.168.0.1; User ID = sa; Password = password “
*************************** *********************** *
Integrated Security – or – Trusted_Connection alse When false, in connection Specifies the user ID and password. When true, will use the current Windows account credentials for authentication. Recognized the value true, false, yes, no and with the true equivalent sspi (strongly recommended).
****************************************** *******
ADO.net database connection
System.Data.SqlClient.SqlConnection
used some of the connection string string (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 = mySQLServe r “);
SqlConnection conn = new SqlConnection (” uid = sa; pwd = passwords; initial catalog = pubs; data source = 127.0.0.1; Connect Timeout = 900 “);
with when connecting to SQL Server and network-related or instance-specific error. Not found or unable to access the server. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (Provider: Named Pipes Provider, error: 40 – Could not open connection to SQL Server)
If your machine installed sql2000 Data Source =. That is certainly not a
< br /> 2000 and 2005 because the instance name is the same as the default instance of 2005 so certainly can not use Data Source =. said
view sql2005 instance name Data Source =. \ SQLEXPRESS SQLEXPRESS used in the you replace the new instance name.
I installed SQL Server 2005 EXPRESS database that comes with VS2008, so the Data Source will be written as:
Data Source =. \ SQLEXPRESS to. SQL2000 prior to use of. No. 2005 can not use.
also encountered a problem today is that SQL 2005 EXPRESS SA account to enable the issue. So now we can not, despite the SA enabled, but still not landing and, later, the authentication is set to SQL Windows Authentication mode, can be in SQL Server Management Studio Express on the log.
VS2008 already comes with a database, and database-driven, and usually the development of commissioning can use this to play. but no database management tool, it can not build the table, in fact, Microsoft offers free management tool:
install Microsoft SQL Server Management Studio Express, you can operate the database.
Download
enabled SA is as follows, on MSE, with windows authentication log,
so you can use SA to log you, of course, can modify their own password .
database opened,. NET can connect to the database, the normal data access, then it is easy to hold a candle after the development.
January 7, 2012 at 3:07 pm Comments (0)