We help IT Professionals succeed at work.

Web config - connection string

I would like to set connection string in webconfig in .net.
I am using local sqlexpress database. I am not sure what to write in Data Source. Can you please help?
Comment
Watch Question

Try following, this will use windows authentication:
<configuration>
 <connectionStrings>
       <add name="ConnectionName" connectionString="Data Source=./SQLExpress;Initial Catalog=DBName;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;" />
 </connectionStrings>
</configuration>

Enjoy,
Ashish Mehta

Commented:
yah you can define the connection string as the above comment and in te datasource

  ConnectionString="<%$ ConnectionStrings:ConnectionName %>"

you can use the connectionstring property of the datasource.
Technical Analyst
Commented:
Have  look at the list of connection strings available:

http://www.connectionstrings.com/sql-server-2005

Hope this helps you.