0
 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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Harmonix
  • 3
  • 3

2 Answers2

0

Use the following code for an Sql Express connection on the local machine:

     Public DbCon = "Data Source=.\sqlexpress;Trusted_Connection=True;" 
masterw
  • 116
  • 4
0

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;
LongArm
  • 208
  • 1
  • 6