Hi...,
I want to know how to develop Runtime Connection String in App.Config using NHibernate ..So.PLease Help Me..
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Pradeep ShetRank #595 · 4K reputationPosted Oct 17, 2014, 5:17 AM EDT
What do you mean by runtime?
You can read the connectionstring from appconfig file with "key" as name
sessionFactory = Fluently.Configure.
Database(MsSqlConfiguration.
MsSql2005.
ConnectionString(Function(c) c.Is(ConfigurationManager.ConnectionString["key"].ConnectionString)).
ShowSql().
MaxFetchDepth(1)).
Mappings(Function(m) m.HbmMappings.AddClasses(GetType(AttestationDeployment),
GetType(DeploymentDestination),
GetType(HistoricalDeploymentReport))).
Mappings(Function(x) x.HbmMappings.AddFromAssembly(Assembly.Load("GeneralMills.BuildAndDeploy.Common"))).
Mappings(Function(m) m.FluentMappings.AddFromAssemblyOf(Of DomainObjectBase)();