The quick-start documentation that comes with ActiveRecord provides the following example configuration.
<?xml version="1.0" encoding="utf-8" ?>
<activerecord>
<config>
<add key="connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="dialect" value="NHibernate.Dialect.MsSql2005Dialect" />
<add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="connection.connection_string" value="Data Source=.;Initial Catalog=test;Integrated Security=SSPI" />
</config>
</activerecord>
I couldn't get this to work. After a bit of fiddling I ended up with the following.
<?xml version="1.0" encoding="utf-8" ?>
<activerecord>
<config>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2005Dialect" />
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.connection.connection_string" value="Server=.;Initial Catalog=TestDatabase;User Id=UserNameGoesHere;Password=PasswordGoesHere " />
</config>
</activerecord>
The main differences are the 'hibernate' prefixes in the keys and the replacement of Data Source with Server in the connection string. This configuration worked against a SQL Server 2005 installation.
No comments:
Post a Comment