orm - NHibernate, create session factory for DB2 database -
i have piece of code :
var cfg = new configuration(); cfg.databaseintegration(x => { x.connectionstring = "datasource=myserver;userid=myuser;password=mypassword; datacompression=true;"; x.dialect<db2400dialect>(); x.driver<db2400driver>(); }); factory = fluently.configure(cfg) .mappings(m => m.fluentmappings.addfromassemblyof<myclassmap>()) .buildsessionfactory(); return factory;
i error :
an invalid or incomplete configuration used while creating sessionfactory. check potentialreasons collection, , innerexception more detail. database not configured through database method
i map few field not fields.
public myclassmap() { table("schemaname.mytable"); map(x => x.field1, "field1").not.nullable(); map(x => x.field2, "field2").not.nullable(); }
i tried , without schema name , db2driver , db2dialect.
any idea ?
thanks,
update1
to solve previous problem added id
id(x => x.myfiledid, "fieldid").generatedby.native();
now have error : could not create driver nhibernate.driver.db2driver, nhibernate, version=3.3.1.4000, culture=neutral, publickeytoken=aa95f207798dfdb4.
Comments
Post a Comment