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 password for the connection database is empty. His nickname is "pwd", so we can write "pwd=".
Note here that your SQL Server must already have a username and password to log in, otherwise you cannot log in in such a way. If your SQL Server is set to Windows logon, then you do not need to use "User ID" and "password" to log in, but you need to use "TRUSTED_CONNECTION=SSPI" to log in.
"Initial Catalog=northwind": The data source used is the database "Northwind". His nickname is "Database", this sentence can be written as "Database=northwind".
"Server=yoursqlserver": Use a server named "YourSQLServer". His nickname is "Data Source", "Address", "Addr". If you are using a local database and you have defined the instance name, you can write as "server= (local) \ Instance name" or "(local)" to the name or IP address of the remote server if it is a remote server.
"Connect timeout=30": The connection time-out is 30 seconds.
C # Connect the SQL Server database connection string < go to >