1.)Standard Security
Connection String :
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Description : Use serverName\instanceName as Data Source to connect to a specific SQL Server instance.
Are you using SQL Server 2008 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server Express installation resides.
2.)Standard Security alternative syntax
Connection String :
Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;
Description : This connection string produce the same result as the previous one. The reason to include it is to point out that some connection string keywords have many equivalents.
3.)Trusted Connection
Connection String :
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;
4.)Trusted Connection alternative syntax
Connection String :
Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;
Description : This connection string produce the same result as the previous one. The reason to include it is to point out that some connection string keywords have many equivalents.
5.)Connecting to an SQL Server instance
Connection String :
Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True;
Description : The syntax of specifying the server instance in the value of the server key is the same for all connection strings for SQL Server.
6.)Trusted Connection from a CE device ( that this will only work on a CE device.)
Connection String :
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;
Description :Often a Windows CE device is not authenticated and logged in to a domain. To use SSPI or trusted connection / authentication from a CE device, use this connection string.