Cannot access non-static field
<p>I can't figure out why it's looking for something static:</p>

<pre><code>public class DatabaseBase
{
    private readonly string connectionString;

    public DatabaseBase(string connectionString)
    {
        this.connectionString = connectionString;
    }
}

public class MyDB : DatabaseBase
{
    readonly string connectionString = ConfigurationManager.AppSettings["MyConnectionString"];

    public MyDB() : base(connectionString)
    {          
    }
}
</code></pre>

<p>I get Cannot access non-static field 'connectionString' in static context.  I don't see anything static in the base Database class so why??</p>

<p>here's another example of when we did kinda the same thing:</p>

<pre><code>partial class Database : DatabaseBase
{

 static string DbConnectionString
 {
  get
  {
   if (dbConnectionString == null)
    dbConnectionString = System.Configuration.ConfigurationManager.AppSettings["MyConnectionString"];

   return dbConnectionString;
  }
 }

 public Database()
  :base(DbConnectionString)
 {
 }
</code></pre>

<p>ok so why did it have to be a static string for the connection string to be passed?</p>
