Hello.
I'm using nHibernate to connect with SQLite database which is located in 
%APPDATA%\MyApplication\DataBase.db3
Full directory is C:\Users\marcin\AppData\Roaming\MyApplication\DataBase.db3
I would like to use %APPDATA%\MyApplication\DataBase.db3 directory in 
app.config file:

* <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">*
* <session-factory>*
* <property name="connection.driver_class">NHibernate.Driver.SQLite20Driver 
</property>*
* <property name="connection.connection_string">**Data Source=**
%APPDATA%\MyApplication\DataBase.db3**;Version=3;**</property>*
* <property name="dialect">NHibernate.Dialect.SQLiteDialect</property>*
* <property 
name="proxyfactory.factory_class">NHibernate.ByteCode.Spring.ProxyFactoryFactory,
 
NHibernate.ByteCode.Spring</property>*
* <mapping assembly="MyApplication.Model"/>*
* </session-factory>*
* </hibernate-configuration>*

When I use *C:\Users\marcin\AppData\Roaming\MyApplication\DataBase.db3* 
directory 
as a Data Source everything works fine.
But when I use Windows environment variable in filepath *
%APPDATA%\MyApplication\DataBase.db3*, nHibernate doesn't see database.
I need this to deploy my application on different environments.
Is there any way to use windows environment variable %APPDATA% in directory?

Thank you,
Marcin

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/RZXLmO3ozroJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to