title: FluentNHibernate SQL Server configuration; connectionstring problem
body: <p>It's my first attempt on Fluent NH. I store the connection string in Properties.Settings; </p>
  
  <pre><code>FnhDbString = Data Source=PC\SQLEXPRESS;Initial Catalog=FNHTest;Integrated Security=True
  </code></pre>
  
  <p>If I configure Fluent with <code>.FromAppSetting</code> I get exception: </p>
  
  <pre><code>ArgumentNullException
  Value cannot be null. Parameter name: Data Source
  </code></pre>
  
  <p>If I configure Fluent with <code>.FromConnectionStringWithKey</code> I get exception: </p>
  
  <pre><code>NullReferenceException
  Object reference not set to an instance of an object.
  </code></pre>
  
  <p>The full method: </p>
  
  <pre><code>private static ISessionFactory CreateSessionFactory()
  { 
        return Fluently.Configure()
          .Database(MsSqlConfiguration.MsSql2008
          .ConnectionString(c =&gt; c
              .FromAppSetting(Properties.Settings.Default.FnhDbString))
          .Cache(c =&gt; c
              .UseQueryCache()).ShowSql())
          .Mappings(m =&gt; m.FluentMappings.AddFromAssemblyOf&lt;Product&gt;())
          .BuildSessionFactory();
  }
  </code></pre>
  
  <p>...</p>
  
  <p>So what am I doing wrong here..?</p>