Discover sql connection string integrated security, include the articles, news, trends, analysis and practical advice about sql connection string integrated security on alibabacloud.com
Failed using IP to connect to SQL Server or configured as a connection string
Scenario One: when in Webconfig used in Files
Scenario Two:
Or, when connecting to SQL Server, enter IP as follows:
Hint that you cannot connect or connect incorrectly.
Solution :
First step: Check TCP/IP did the protocol start:
The SQL String concatenation function uses CONCAT () in the SQL String concatenation function. The CONCAT () syntax is as follows: CONCAT (string 1, string 2, string 3 ,...): concatenat
Steps:
One, new text document Xxx.txt, modify file type is. udl
Open the document and find the corresponding service in the provision of data.
Select the required database in the connection and fill in the relevant information.
Test the connection, if successful, skip to the next step, the failure is the user information is incorrect, modify.
V. To change the xxx.udl suffix name to txt, the
To configure the database connection string in Webconfig, the code is as follows:
Copy Code code as follows:
Then get the connection string inside the Webform_1.aspx.cs to add the following reference;
Copy Code code as follows:
Using System.Configuration;
Using System.Data;
Usi
ODBC: Connecting to databases
The code is as follows
Copy Code
Driver={sql Server}; server=rousecms.hostedresource.com; Database=rousecms; Uid=rousecms; pwd= ' Your password ';
OLE DB, OleDbConnection (. NET): Connecting to a database
The code is as follows
Copy Code
Provider=sqloledb; Data source=rousecms.hostedresource.com; Initial Catalog=rousecms; User Id=rousecms; Password= ' You
Label:Connection string 1:data source=localhost,1433; User Id=sa; Password=123;initial catalog=test; Min Pool size=1; Max Pool Size = 512; Connection string 2:data source=localhost; User Id=sa; Password=123;initial catalog=test; TCP/IP in SQL Server database if not turned on, only the second sentence of the
Label:MS SQL Server Database connection string detailedC # Connection string set timeout timeSqlconnection.connectiontimeout and Sqlcommand.commandtimeout and Sqlbulkcopy.bulkcopytimeout propertiesHttps://msdn.microsoft.com/zh-cn/library/8xx3tyca.aspx
Label:C # Connect a SQL Server database connection string, we introduce a parameter (note: The parameters are separated by semicolons):"User Id=sa": The authenticated user name for the connection database is SA. He also has an alias "UID", so this sentence we can also write "Uid=sa"."Password=": The authentication pass
) service name" is the global database name of the database you created earlier. At this point, a service named Server_ip, Server_port, and db_name three features are configured to complete. Click Next. 5. Test or Complete: Click "Finish" to exit the wizard. Or click the "Test" button to test whether the above configuration is correct: Make sure that the user ID you used for your test is not locked. You can click on the "Change Login" button to select another account test. If the test fails,
First step: Create a Wizard FileCreate a TXT file on the desktop and change the file suffix to ". udl".
Step Two: Select the Provider tab pageDouble-click the newly created. udl file, enter the Provider tab, and select Microsoft OLE DB Provider for SQL Server.
Step three: Set up "Connect"After the second step, select the "Next" button and go to "Connect" tab, in "1. Select or enter the server name (E)" Enter ".", then select "2. Enter information
2 Services for User Profile Service the Forefront Identity Manager service and the Forefront Identity Manager Synchronization Service cannot start the prompt as wrong Miss: Execute the following PowerShell script: Use the following command to obtain a UPS service instance to the current server site: $UPSInstances = Get-spserviceinstance |? {$_. GetType (). ToString ()-eq "Microsoft.Office.Server.Administration.UserProfileServiceInstance"} Use the following command to obtain an instance of the
To configure the database connection string in Webconfig, the code is as follows:
Copy Code code as follows:
Then get the connection string inside the Webform_1.aspx.cs to add the following reference;
Copy Code code as follows:
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
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.