ASP.NET Configurations: Retrieve Multiple Connection Strings From The Current Web Application's Web.config File
So you have to work with multiple connection strings that you want to use in the Web.config file and you want to use it in the code behind file. Below are the steps to retrieve multiple connection strings in the web.config file programmatically. 1. Make sure you have connection strings in your Web.config file. A connection string looks something like this. <connectionStrings> <add name="NorthwindConnectionString" connectionString="Data Source=(local); Initial Catalog=Northwind;Integrated Security=True" providerName="System.Data.SqlClient" /> <add name="AdventureWorksConnectionString" connectionString="Data Source=(local); Initial Catalog=AdventureWorks;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> 2. Now in the Default.aspx.cs file type in the following in the top of the file, where all the using statements are to use the System.Web.Co...