Connection string:
<Connectionstrings>
<Add name = "conn" connectionstring = "User ID = sa; Password =; initial catalog = northwind; server = yoursqlserver; Connect timeout = 30;" providername = "system. data. sqlclient "/>
</Connectionstrings>
--------------------------------------------------------------------------------
Description of parameters (Note: parameters are separated by semicolons ):
"User ID = sa": the authenticated user name used to connect to the database is Sa. It also has an alias "uid", so we can also write this statement as "uid = sa ".
"Password =": The verification password for connecting to the database is blank. Its alias is "PWD", so we can write it as "Pwd = ".
Note that your SQL server must have a user name and password set to log on. Otherwise, you cannot log on using this method. if your SQL Server is set to Windows logon, you do not need to use the "user ID" and "password" methods to log on here, you need to use "trusted_connection = sspi" to log on.
"Initial catalog = northwind": the data source used is "northwind". Its alias is "Database". This statement can be written as "database = northwind ".
"Server = yoursqlserver": Use a server named "yoursqlserver. its alias is "Data Source", "Address", "ADDR ". if the local database is used and the Instance name is defined, you can enter "Server = (local) \ Instance name". If it is a remote server) "Replace with the name or IP address of the remote server.
"Connect timeout = 30": the connection timeout is 30 seconds.
Note: The above user ID and password can be in upper or lower case, regardless of case.