【发布时间】:2014-05-27 16:18:38
【问题描述】:
我正在构建一个 ASP.NET MVC 项目并使用 NHibernate 而不是 Entity Framework。
我遇到的问题是在 Configuration 对象中调用 BuildSessionFactory() 方法时出现 ArgumentException: Keyword not supported: 'initial catalog'。
config = new Configuration();
config.Configure();
sessionFactory = config.BuildSessionFactory();
session = sessionFactory.OpenSession();
IList<Catalogue> catalogues = (from c in session.Query<Catalogue>()
select c).ToList();
return this.Json(catalogues, JsonRequestBehavior.AllowGet);
我的连接字符串是
<property name="connection.connection_string">Data Source=.\SQLEXPRESS;Initial Catalog=Passion4Performance;Integrated Security=True</property>
我尝试了很多解决方案,但似乎没有任何解决方法。 提前谢谢你。
【问题讨论】:
标签: c# asp.net-mvc nhibernate