What is the best place to store Database connection string?

Platform: ASP.NET|Category: Config files

In Web.Config, you would add a key to the AppSettings Section:

<appSettings> 
<add key='MyDBConnection' value='server=<ServerName>;uid=<Username>;pwd=<password>;database=<DBName>' />
</appSettings>
</password>

Example :

<add key='ConnectionString' value= 'Server=localhost;uid=sa;pwd=;database=northwind' />

Then, in your ASP.Net application – just refer to it like this:

Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings('ConnectionString'))