how i can create database in sql server by nhibernate fluent. i use this 
code:
*********************

      string server = "localhost\\SQLEXPRESS";
        string database = "NameDb";
        const string user = "admin";
        const string password = "admin";

            var connectionString = string.Format("Server={0};Database={1};User 
Id={2};Password={3};",
                                                 server, database, user, 
password);
            var autoMap = AutoMap.AssemblyOf<AggregateBase>()
                .Where(t => typeof(AggregateBase).IsAssignableFrom(t));

            SessionFactory = Fluently.Configure()
                
.Database(MsSqlConfiguration.MsSql2008.ConnectionString(connectionString))
                .Mappings(m => m.AutoMappings.Add(autoMap))
                .ExposeConfiguration(TreatConfiguration)
                .BuildSessionFactory();

 protected  static void TreatConfiguration(NHibernate.Cfg.Configuration 
configuration)
        {
            var update = new  SchemaUpdate(configuration);
            update.Execute(false, true);
 }

but it creates just the schema, if there is no namedb in sql server did not 
generate the database

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to