Well, that would be a function of the data provider if they do that during 
connection string parser, so it would be whether or not SQLite will expand 
that variable or not. And from what you say, i would say not. You should be 
able to take the connection string out of the configuration file and set it 
in code when you build your configuration though.

On Friday, April 20, 2012 11:36:35 AM UTC-6, marcin wrote:
>
> 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/-/Zxb44JOiATsJ.
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