Hi
Please Try this
In Your App.Config file looks like
<configuration>
<connectionstrings>
<add name="DBConnectionString">
connectionString="Data Source=Manoj;Initial Catalog=Test;Persist Security Info=True;User ID=sa;Password=admin123"
providerName="System.Data.SqlClient" />
</add></connectionstrings>
</configuration>
Please Add Reference "System.Configuration.dll"
IN your code
using System.Configuration;
string nwConn = System.Configuration.ConfigurationManager.ConnectionStrings[1].ToString();