Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using 'Bootstrapper' class inside the Method is:

C#
private static void ConfigureNHibernate()
        {
            NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration().Configure();
            cfg.Properties["connection.connection_string"] = ConfigurationManager.ConnectionStrings["DefaultConnectionString"].ConnectionString;
           
        }


And in Web.config:

XML
<configuration>
<configsections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data" />
  </configsections>
  <connectionstrings>   
    <add name="sql" connectionstring="Data Source=192.168.3.250;Initial Catalog=MNTPayroll;User ID=sa;Password=hbd123@2" providername="System.Data.SqlClient" />    
  </connectionstrings>
  <dataconfiguration defaultdatabase="sql" />


I want to use multi-DataBase server. how can I do this and how can I use the second or third Database connection string to my application when to access...
Posted
Updated 25-Sep-12 20:44pm
v2

1 solution

What about googling a little bit: Using NHibernate with Multiple Databases[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900