title: Cannot login to SQL Server using NHibernate, but with Management Studio or sqlcmd it works
body: <p>Im getting login failed error when trying to connect to my database using NHibernate:</p>
  
  <pre><code>var config = Fluently.Configure()
                .Database(MsSqlConfiguration
                .MsSql2005
                .ConnectionString("Data Source=SERVER1\\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=xxx"))
                .Mappings(x =&gt; x.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly()));
  </code></pre>
  
  <p>With <code>Error 18456 State 5</code> in the log viewer in SQL Management Studio.</p>
  
  <p>But using <code>sqlcmd</code> or Management Studio it works fine (using Windows Auth)!</p>
  
  <p>What could be the problem?</p>
  
  <p><strong>EDIT</strong>
  The NHibernate exception:</p>
  
  <pre><code>Test method ProjektLogg.Tests.NHibernateTests.ShouldBeAbleToGenerateFactory threw exception: 
  FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
  
   ---&gt; NHibernate.HibernateException: Login failed for user XXX-INTRANET\username. ---&gt; System.Data.SqlClient.SqlException: Login failed for user XXX-INTRANET\username.
  </code></pre>