Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi friends

i have 3 database with same schema, i want to first database product table data and insert this table data in to remaining database product tables mean databases are individual but schema is same (may be database on individual machines but schema is same), and i am using following configuration for database fluentnhibenate so is it possible to do that, if it is possible can any one help me please......

Thanks



C#
public static void InitializeSessionFactory(string connectionString = "Data Source=local;Initial Catalog=mydb;Integrated Security=true;")
 {
            _sessionFactory = Fluently.Configure()
                 .Database(MsSqlConfiguration.MsSql2008
                               .ConnectionString(connectionString).ShowSql()
                 )
                 .Mappings(m =>
                           m.FluentMappings
                               .AddFromAssemblyOf<Category>())
                 .ExposeConfiguration(cfg => new SchemaExport(cfg)
                 .Create(false, false))
                 .BuildSessionFactory();
}

C#
public static ISessionFactory SessionFactory
       {
           get
           {
               if (_sessionFactory == null)
                   InitializeSessionFactory();
               return _sessionFactory;
           }
       }


C#
public static ISession OpenSession()
        {
            return SessionFactory.OpenSession();
        }
Posted

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