Yes, you can. Put the connection string in the normal <connectionStrings> element in app.config. In the NHibernate config, replace connection.connection_string with connection.connection_string_name, and give it the constr name.
On Fri, Sep 26, 2008 at 5:50 PM, Bil Simser <[EMAIL PROTECTED]> wrote: > > So currently we're using nhibernate.cfg.xml which contains all the > regular stuff you configure with NH (including connection string). > What I'm asking is can we keep nhibernate.cfg.xml for all the settings > *except* the connection string and use app.config with a connection > string (which can be encrypted) inside the NH section. In other words, > can I split the configuration to be in both places or do I have to use > app.config if I want to encrypt the connection string? > > On Sep 26, 8:21 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote: > > Not following you. > > You can refer the connection string to the <connectionStrings> element in > > the web.config. > > Do you need anything else? > > > > > > > > On Fri, Sep 26, 2008 at 5:18 PM, Bil Simser <[EMAIL PROTECTED]> > wrote: > > > > > Oren, > > > > > Can you mix using the config file for NH settings and web/app config > > > for the connection string or does it have to be one or the other? We > > > currently have the config outside in it's own nh.cfg file which is > > > nice as it's rebuilt for each environment by the build server. Just > > > don't like littering the app.config with lots of values. > > > > > Thanks. > > > > > On Sep 26, 6:56 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote: > > > > You don't. > > > > You use connection_string_name and encrypt the connection string in > the > > > > web.config > > > > > > On Fri, Sep 26, 2008 at 3:54 PM, Bil Simser <[EMAIL PROTECTED]> > > > wrote: > > > > > > > The link provided is to encrypt web.config settings (which you can > do > > > > > much easily with K. Scott Allens blog post here: > > > > >http://odetocode.com/Blogs/scott/archive/2006/01/08/2707.aspx). > > > > > > > How do you encrypt the nhibernate.cfg.xml file so that it can be > > > > > decrypted by NH at runtime? > > > > > > > On Aug 14, 7:44 am, Jason Meckley <[EMAIL PROTECTED]> wrote: > > > > > > there is a hibernate configuration setting to ge the connection > > > string > > > > > > from the config file. The connection strings within a config file > can > > > > > > be encrypted. > > > > > > http://www.google.com/search?q=encrypt+web.config+connection+strings > > > > > > this should provide the security you require. > > > > > > On Aug 14, 9:24 am, "Ricardo Borges" <[EMAIL PROTECTED]> > > > wrote: > > > > > > > > > I've had a problem. > > > > > > > > > My connection string (user and password db) can not be visible > in > > > > > web.config > > > > > > > or hibernate.cfg.xml in the application server. > > > > > > > > > How toencryptit ? > > > > > > > > > []'s > > > > > > > > > R- Hide quoted text - > > > > > > > > - Show quoted text -- Hide quoted text - > > > > > > - Show quoted text -- Hide quoted text - > > > > - Show quoted text - > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. 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 -~----------~----~----~----~------~----~------~--~---
