I'm generating Schema.sql file and I want programatically to create sqllite db file and execute all sql statements from file.
thanks
I'm generating Schema.sql file and I want programatically to create sqllite db file and execute all sql statements from file.
thanks
You can use the SchemaExport class to generate the scripts, and/or apply them to the database : http://nhibernate.info/doc/tutorials/first-nh-app/your-first-nhibernate-based-application.html
public class GenerateSchema_Fixture
{
[Test]
public void Can_generate_schema()
{
var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(typeof (Product).Assembly);
new SchemaExport(cfg).Execute(true /*script*/, true /*export to db*/,
false /*just drop*/, true /*format schema*/);
}
}