<p>I have created a class to dynamically put together SQL function statements within a project. I have found this class to be pretty useful and would like to incorporate into future projects</p>

<p>namespace connectionClass</p>

<p>{</p>

<pre><code> public class connClass

 {      

     NpgsqlConnection conn = new NpgsqlConnection(projectName.Properties.Settings.Default.ConnString);  

 }
</code></pre>

<p>}</p>

<p>I want to be able to dynamically input the project name without having to do it myself for every different class! the connection string will be defined within the properties settings in VS.</p>

<p>Any help would be greatly appreciated:)</p>

One option is to have the connection class use the ConfigurationManager to get the name from the App.Config file - but this still means setting the name in there. Something like
```
```
ConfigurationManager.AppSettings["PROJECT_NAME"];
```
```