Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Use encryption on the password and/or connection string and store the encrypted password/connection string in a config file of some sort. Then use my answer here to add the connection string value to the NHibernate Configuration object after decrypting it:

How to load application settings to NHibernate.Cfg.Configuration object?How to load application settings to NHibernate.Cfg.Configuration object?

Like:

nHibernateConfiguration.SetProperty( 
  NHibernate.Cfg.Environment.ConnectionString,
  Util.Decrypt(encryptedConnectionString)); 

Use encryption on the password and/or connection string and store the encrypted password/connection string in a config file of some sort. Then use my answer here to add the connection string value to the NHibernate Configuration object after decrypting it:

How to load application settings to NHibernate.Cfg.Configuration object?

Like:

nHibernateConfiguration.SetProperty( 
  NHibernate.Cfg.Environment.ConnectionString,
  Util.Decrypt(encryptedConnectionString)); 

Use encryption on the password and/or connection string and store the encrypted password/connection string in a config file of some sort. Then use my answer here to add the connection string value to the NHibernate Configuration object after decrypting it:

How to load application settings to NHibernate.Cfg.Configuration object?

Like:

nHibernateConfiguration.SetProperty( 
  NHibernate.Cfg.Environment.ConnectionString,
  Util.Decrypt(encryptedConnectionString)); 
Source Link
Michael Maddox
  • 12.5k
  • 5
  • 41
  • 40

Use encryption on the password and/or connection string and store the encrypted password/connection string in a config file of some sort. Then use my answer here to add the connection string value to the NHibernate Configuration object after decrypting it:

How to load application settings to NHibernate.Cfg.Configuration object?

Like:

nHibernateConfiguration.SetProperty( 
  NHibernate.Cfg.Environment.ConnectionString,
  Util.Decrypt(encryptedConnectionString));