Thanks for helping ! I'm really getting frustrated with this.
Are you suggesting I should not call cfg.Configure(); ?
I've tried that but I get the following exception :
Quote:
The hibernate.connection.driver_class must be specified in the NHibernate configuration section.
So I've tried to redefine all the properties in the code as such :
Code:
cfg.SetProperty("connection.provider", "NHibernate.Connection.DriverConnectionProvider");
cfg.SetProperty("connection.driver_class", "NHibernate.Driver.SqlClientDriver");
cfg.SetProperty("dialect", "NHibernate.Dialect.MsSql2005Dialect");
cfg.SetProperty("hibernate.connection.connection_string", _cnnMgr.GetConnectionString("anotherConnectionString");
cfg.SetProperty("connection.connection_string", _cnnMgr.GetConnectionString("anotherConnectionString");
But I'm still getting the same error...
I can't understand why SetProperty just doesnt do the job, as it should be its purpose to change a property at runtime (in my case the connection string)