I want to know that How to read created connection string of Web.Config in code behind to pass query?
My project is C# ASP.NET 4.0 and Sql Server 2010 based.
for e.g. if my Connection String in Web.Config
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
than, how to use it in Code behind to pass some sql query say,
select * nikhil where name='Tamhankar';