NHibernate - How to get the current Database connection string?
ASP.NET
1
Posts
1
Posters
0
Views
1
Watching
-
In NHibernate, how do I retrieve the current SQL Database connection string? At the moment I'm using...
ISession session = NHibernateHelper.GetCurrentSession(); string connection = session.Connection.ConnectionString;
Thing is it's returning the connection string with the Password element missing so if my connection string in the web.config is...<property name="connection.connection_string"> Server=localhost; Initial Catalog=Database; Uid=sa; Pwd=password; </property>
It ends up returning...Server=localhost; Initial Catalog=Database; Uid=sa;
...which isn't the correct connection string.Dominic Pettifer Blog: www.dominicpettifer.co.uk