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?
Watch Question

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

Ashish Mehta

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
Have  look at the list of connection strings available:


Hope this helps you.