Now I was using the spring asp.net + Nhibernate + sqlite asp.net, on the way of sqlite file is and password, but I don't know how to in the spring the.net + Nhibernate + sqlite asp.net this environment configuration.
The configuration items as follows:
IDao.xml
so,i still didn't connect the sqlite.net provider,the error message isCode:<?xml version="1.0" encoding="utf-8" ?> <objects xmlns="http://www.springframework.net" xmlns:db="http://www.springframework.net/database"> <object type="Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core"> <property name="ConfigSections" value="databaseSettings"/> </object> <db:provider id="DbProvider" provider="System.Data.SQLite" connectionString="Data Source=|DataDirectory|\AppData\***.db;Version=3;Password=......"/> <object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate32"> <property name="DbProvider" ref="DbProvider"/> <property name="MappingAssemblies"> <list> <value>RZSMB.Domain</value> </list> </property> <property name="HibernateProperties"> <dictionary> <entry key="hibernate.current_session_context_class" value="Spring.Data.NHibernate.SpringSessionContext, Spring.Data.NHibernate32"/> <entry key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/> <entry key="dialect" value="NHibernate.Dialect.SQLiteDialect"/> <entry key="connection.driver_class" value="NHibernate.Driver.SQLite20Driver"/> <entry key="show_sql" value="false"/> <entry key="cache.use_query_cache" value="true"/> <entry key="hbm2ddl.auto" value="update"/> <entry key="command_timeout" value="60"/> <entry key="query.substitutions" value="true 1, false 0, yes 'Y', no 'N'"/> </dictionary> </property> <property name="ExposeTransactionAwareSessionFactory" value="true" /> </object> <object id="HibernateTemplate" type="Spring.Data.NHibernate.Generic.HibernateTemplate"> <property name="SessionFactory" ref="NHibernateSessionFactory" /> <property name="TemplateFlushMode" value="Auto" /> <property name="CacheQueries" value="true" /> </object> <object id="AdoTemplate" type="Spring.Data.Core.AdoTemplate, Spring.Data"> <property name="DbProvider" ref="DbProvider"/> <property name="DataReaderWrapperType" value="Spring.Data.Support.NullMappingDataReader, Spring.Data"/> </object> </objects>
please help me solve this problem!Code:System.Configuration.ConfigurationErrorsException: Error creating context 'spring.root': File opened that is not a database file file is encrypted or is not a database ---> Spring.Objects.Factory.ObjectCreationException: Error creating object with name 'NHibernateSessionFactory' defined in 'assembly [RZSMB.Dao, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null], resource [RZSMB.Dao.Config.IDao.xml] line 9' : Initialization of object failed : File opened that is not a database file file is encrypted or is not a database ---> System.Data.SQLite.SQLiteException: File opened that is not a database file file is encrypted or is not a database
thanks.


Reply With Quote