This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9254|Reply: 0

[Communication] C# connects sqlserver to two types of connection strings for windows and sqlserver authentication

[Copy link]
Posted on 11/15/2019 2:25:20 PM | | |
sql server authentication connection string private string ConnstrSqlServer = "server=server name; uid=login name; pwd = login password; database=database name";

windows authentication connection string private string connstrWindows = "server=server name; database=database name; Trusted_Connection=SSPI";



Access the SQL Server 2008 database in C# code using SqlClient   

.NET Framework Data Provider for SQL Server standard writing   
Data Source=myServerAddress; Initial Catalog=myDataBase; User Id=myUsername; Password=myPassword;   

.NET Framework Data Provider for SQL Server is another standard way to write it   
Server=myServerAddress; Database=myDataBase; User ID=myUsername; Password=myPassword; Trusted_Connection=False;   

.NET Framework Data Provider for SQL Server Trust Connection Writing   
Data Source=myServerAddress; Initial Catalog=myDataBase; Integrated Security=SSPI;   

The .NET Framework Data Provider for SQL Server is another way to write trust connections   
Server=myServerAddress; Database=myDataBase; Trusted_Connection=True;





Previous:URL secure Base64 encoding, decoding
Next:efcore Add-Migration error
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com