Public DbCon = "Data Source="";User ID="";Password="";Initial Catalog="";"
So far this is the code for SQL Server Authentication that I know.
I want to know the connection string for Windows Authentication
Public DbCon = "Data Source="";User ID="";Password="";Initial Catalog="";"
So far this is the code for SQL Server Authentication that I know.
I want to know the connection string for Windows Authentication
Use the following code for an Sql Express connection on the local machine:
Public DbCon = "Data Source=.\sqlexpress;Trusted_Connection=True;"
Have a look at http://www.connectionstrings.com/sql-server/
The 2005 specific connection string is:
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
Unless you have specified an instance name during SQL Express setup, in which case use:
Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;