标签:
最近在研究ActiveRecord网上有很多贴子讲怎么用的。但自己照做就是出错。
最终定位在配置文件出错。应该是ActiveRecord有更新的原因。在国外的网站把配置复制了一份替换。问题解决了。我用的是castle.ActiveRecord + mysql
<configSections> <section name="activerecord" type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" /> </configSections>
<activerecord isWeb="true"> <config> <add key="connection.driver_class" value="NHibernate.Driver.MySqlDataDriver" /> <add key="dialect" value="NHibernate.Dialect.MySQLDialect" /> <add key="connection.provider" value="NHibernate.Connection.DriverConnectionProvider" /> <add key="connection.connection_string" value="Database=test;Data Source=localhost;User Id=root;Password=root;" /> <add key="proxyfactory.factory_class" value="NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle" /> <add key="query.factory_class" value="NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory, NHibernate" /> </config> </activerecord>
这里还有关于连别的库的配置:
http://docs.castleproject.org/Default.aspx?Page=Configuration%20Reference&NS=Active%20Record&AspxAutoDetectCookieSupport=1
标签:
原文地址:http://www.cnblogs.com/lookforFree/p/4333795.html