title: NHibernate Configuration Error - Connection String?
body: <p>I am getting this error:</p>
  
  <p>------ Test started: Assembly: ECEHire.Test.dll ------</p>
  
  <p>Test 'ECEHire.Test.Tests.GenerateSchema_Fixture.Can_generate_schema' failed: NHibernate.HibernateException : Format of the initialization string does not conform to specification starting at index 49.
    ----> System.ArgumentException : Format of the initialization string does not conform to specification starting at index 49.
      at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action<code>1 scriptAction, Boolean export, Boolean justDrop)
      at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Boolean script, Boolean export, Boolean justDrop)
      GenerateSchema_Fixture.vb(18,0): at ECEHire.Test.Tests.GenerateSchema_Fixture.Can_generate_schema()
      --ArgumentException
      at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String&amp; keyname, String&amp; keyvalue)
      at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
      at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
      at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
      at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
      at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions&amp; userConnectionOptions)
      at System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value)
      at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
      at NHibernate.Connection.DriverConnectionProvider.GetConnection()
      at NHibernate.Tool.hbm2ddl.SchemaExport.Execute(Action</code>1 scriptAction, Boolean export, Boolean justDrop)</p>
  
  <p>0 passed, 1 failed, 0 skipped, took 3.23 seconds (NUnit 2.5.10).</p>
  
  <p>When I try to test my NHibernate configuration file. </p>
  
  <p>The configuration file is:  </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"&gt;
    &lt;session-factory&gt;
      &lt;property name="dialect"&gt;NHibernate.Dialect.MsSql2005Dialect&lt;/property&gt;
      &lt;property name="connection.connection_string"&gt;Data Source=MyServerName;initial catalog=MyDatabaseName;Integrated Security=SSPI&lt;/property&gt;
      &lt;property name="connection.isolation"&gt;ReadCommitted&lt;/property&gt;
      &lt;property name="proxyfactory.factory_class"&gt;NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu&lt;/property&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>The test that I am running is:</p>
  
  <pre><code>&lt;Test()&gt; _
  Public Sub Can_generate_schema()
  
      Dim cfg = New Configuration()
      cfg.Configure()
      cfg.AddAssembly(GetType(Question).Assembly)
      Dim exp As NHibernate.Tool.hbm2ddl.SchemaExport = New NHibernate.Tool.hbm2ddl.SchemaExport(cfg)
      exp.Execute(False, True, False)
  
  End Sub
  </code></pre>
  
  <p>I believe that this is a connection string error, but the connection string works as part of the web.config file for querying the database via ADO.</p>