在数据访问层引用MySql.Data.dll,在web.config添加配置如下(版本号要匹配):
其实是6.3.4.0的要与NHibernate3搭配
fullName="MySql.Data, Version=6.3.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
附hibernate.cfg.xml
NHibernate.Connection.DriverConnectionProvider
NHibernate.Driver.MySqlDataDriver
Data Source=localhost;user=root;password=123456;database=finance;
NHibernate.Dialect.MySQL5Dialect
10
true
true
10
true 1, false 0, yes 'Y', no 'N'
NHibernate.ByteCode.Castle.ProxyFactoryFactory,NHibernate.ByteCode.Castle
nhibernate版本问题:在app.config或web.config添加配置如下