Posted on: 12/1/2014 10:52:46 PM | Views : 409

I have a class library that has app.config I placed my connection string there as follows:
<configuration> <configSections> <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" requirePermission="true"/> </configSections> <connectionStrings> <clear /> <add name="Acquisition" connectionString="Data Source=104.130.90.244;Initial Catalog=Hub;Persist Security Info=True;User ID=webApp;Password=webApp" providerName="System.Data.SqlClient"/> </connectionStrings>

in my method I call the connection string as:
private const string connectionName = "Acquisition"; string myConnection = ConfigurationManager.ConnectionStrings[connectionName].ToStr ...

Go to the complete details ...